提交 aadcb6f3 编写于 作者: S serge-rider

PostgreSQL partitions/inheritance model

上级 1de113cc
Bundle-Vendor = JKISS
Bundle-Name = DBeaver PostgreSQL Support
Bundle-Vendor = JKISS
Bundle-Name = DBeaver PostgreSQL Support
dialog.connection.header=PostgreSQL Connection Settings
editor.session_manager.name=Session Manager
......@@ -334,10 +334,9 @@ meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTableReal.rowCountEstimate.na
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTableReal.rowCountEstimate.description=
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTableReal.diskSpace.name=Disk Space
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTableReal.diskSpace.description=
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablePartition.partKeys.name=Partition Keys
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablePartition.partKeys.description=
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablePartition.partKeys.name=Partition Keys
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablePartition.partKeys.description=
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablespace.name.name=Name
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablespace.name.description=
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablespace.options.name=Options
......@@ -478,15 +477,15 @@ tree.procedures.node.name=Procedures
tree.reference.node.name=Reference
tree.reference_columns.node.name=Reference columns
tree.references.node.name=References
tree.partition.node.name=Partition
tree.partition_columns.node.name=Partition columns
tree.partitions.node.name=Partitions
tree.tablechildren.node.name=Child tables
tree.tablechildren_columns.node.name=Child Tables columns
tree.tablechildren.node.name=Child tables
tree.rules.node.name=Rules
tree.rules_columns.node.name=Rules columns
tree.rules.node.name=Rules
tree.partition.node.name=Partition
tree.partition_columns.node.name=Partition columns
tree.partitions.node.name=Partitions
tree.tablechildren.node.name=Child tables
tree.tablechildren_columns.node.name=Child Tables columns
tree.tablechildren.node.name=Child tables
tree.rules.node.name=Rules
tree.rules_columns.node.name=Rules columns
tree.rules.node.name=Rules
tree.schema.node.name=Schema
tree.schemas.node.name=Schemas
tree.sequence.node.name=Sequence
......
......@@ -345,6 +345,8 @@ meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTableReal.rowCountEstimate.na
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTableReal.rowCountEstimate.description=
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTableReal.diskSpace.name=Disk Space
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTableReal.diskSpace.description=
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablePartition.partKeys.name=Partition Keys
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablePartition.partKeys.description=
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablespace.name.name=Name
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablespace.name.description=
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablespace.options.name=Options
......
......@@ -38,7 +38,6 @@ import org.jkiss.dbeaver.model.impl.jdbc.JDBCUtils;
import org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCObjectCache;
import org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCObjectLookupCache;
import org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCPreparedStatementCachedImpl;
import org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl;
import org.jkiss.dbeaver.model.meta.Association;
import org.jkiss.dbeaver.model.meta.Property;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
......@@ -46,7 +45,6 @@ import org.jkiss.dbeaver.model.struct.*;
import org.jkiss.dbeaver.model.struct.rdb.DBSCatalog;
import org.jkiss.utils.LongKeyMap;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Collection;
import java.util.Collections;
......@@ -55,8 +53,6 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import javax.xml.crypto.dsig.keyinfo.PGPData;
/**
* PostgreDatabase
*/
......
......@@ -32,8 +32,6 @@ import org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCCompositeCache;
import org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCObjectCache;
import org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCObjectLookupCache;
import org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCStructLookupCache;
import org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCPreparedStatementCachedImpl;
import org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCPreparedStatementImpl;
import org.jkiss.dbeaver.model.meta.Association;
import org.jkiss.dbeaver.model.meta.Property;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
......@@ -62,15 +60,16 @@ public class PostgreSchema implements DBSSchema, DBPNamedObject2, DBPSaveableObj
private static final String TABLE_CHILD_ID = "PostgreSchema.TABLE_CHILD";
private static final String sqlTableChild = "SELECT c.relname,a.*,pg_catalog.pg_get_expr(ad.adbin, ad.adrelid, true) as def_value,dsc.description" +
"\nFROM pg_catalog.pg_attribute a" +
"\nINNER JOIN pg_catalog.pg_class c ON (a.attrelid=c.oid)" +
"\nLEFT OUTER JOIN pg_catalog.pg_attrdef ad ON (a.attrelid=ad.adrelid AND a.attnum = ad.adnum)" +
"\nLEFT OUTER JOIN pg_catalog.pg_description dsc ON (c.oid=dsc.objoid AND a.attnum = dsc.objsubid)" +
"\nWHERE NOT a.attisdropped AND c.oid=? ORDER BY a.attnum";
private static final String SQL_CHILDTABLE_QUERY =
"SELECT c.relname,a.*,pg_catalog.pg_get_expr(ad.adbin, ad.adrelid, true) as def_value,dsc.description" +
"\nFROM pg_catalog.pg_attribute a" +
"\nINNER JOIN pg_catalog.pg_class c ON (a.attrelid=c.oid)" +
"\nLEFT OUTER JOIN pg_catalog.pg_attrdef ad ON (a.attrelid=ad.adrelid AND a.attnum = ad.adnum)" +
"\nLEFT OUTER JOIN pg_catalog.pg_description dsc ON (c.oid=dsc.objoid AND a.attnum = dsc.objsubid)" +
"\nWHERE NOT a.attisdropped AND c.oid=? ORDER BY a.attnum";
private PostgreDatabase database;
private final PostgreDatabase database;
private long oid;
private String name;
private String description;
......@@ -484,19 +483,20 @@ public class PostgreSchema implements DBSSchema, DBPNamedObject2, DBPSaveableObj
protected JDBCStatement prepareChildrenStatement(@NotNull JDBCSession session, @NotNull PostgreSchema owner, @Nullable PostgreTableBase forTable)
throws SQLException
{
if (forTable == null) {
if (forTable == null) {
return prepareChildrenStatement(session,owner);
}
/*
JDBCPreparedStatementCachedImpl dbStat;
dbStat = database.statmentCache.get(TABLE_CHILD_ID);
if (dbStat == null) {
dbStat = new JDBCPreparedStatementCachedImpl((JDBCPreparedStatementImpl) session.prepareStatement(sqlTableChild));
dbStat = new JDBCPreparedStatementCachedImpl((JDBCPreparedStatementImpl) session.prepareStatement(SQL_CHILDTABLE_QUERY));
database.statmentCache.put(TABLE_CHILD_ID, dbStat);
}
*/
JDBCPreparedStatement dbStat = session.prepareStatement(SQL_CHILDTABLE_QUERY);
dbStat.setLong(1, forTable.getObjectId());
return dbStat;
}
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.model.impl.jdbc.exec;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册