Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
e51f7dc4
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
e51f7dc4
编写于
5月 17, 2019
作者:
S
Serge Rider
提交者:
GitHub
5月 17, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5929 from dbeaver/5780_PG_Partition_expr
5780 Postrges partition expression
上级
bc2b6b0e
31aff396
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
26 addition
and
6 deletion
+26
-6
plugins/org.jkiss.dbeaver.ext.postgresql/OSGI-INF/l10n/bundle.properties
...ss.dbeaver.ext.postgresql/OSGI-INF/l10n/bundle.properties
+2
-2
plugins/org.jkiss.dbeaver.ext.postgresql/OSGI-INF/l10n/bundle_ru.properties
...dbeaver.ext.postgresql/OSGI-INF/l10n/bundle_ru.properties
+2
-2
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreClass.java
.../org/jkiss/dbeaver/ext/postgresql/model/PostgreClass.java
+1
-0
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreSchema.java
...org/jkiss/dbeaver/ext/postgresql/model/PostgreSchema.java
+8
-1
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreTablePartition.java
...s/dbeaver/ext/postgresql/model/PostgreTablePartition.java
+11
-1
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/impls/PostgreServerExtensionBase.java
...xt/postgresql/model/impls/PostgreServerExtensionBase.java
+2
-0
未找到文件。
plugins/org.jkiss.dbeaver.ext.postgresql/OSGI-INF/l10n/bundle.properties
浏览文件 @
e51f7dc4
...
...
@@ -421,8 +421,8 @@ meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTableReal.diskSpace.name=Disk
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTableReal.diskSpace.description
=
Total disk space used by the specified table, including all indexes and TOAST data
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTableReal.relationSize.name
=
Rel Size
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTableReal.relationSize.description
=
Disk space used by the fork 'main'
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.
expr.name
=
Partition Expression
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablePartition.
expr
.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
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/OSGI-INF/l10n/bundle_ru.properties
浏览文件 @
e51f7dc4
...
...
@@ -372,8 +372,8 @@ meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTableReal.diskSpace.name=\u04
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTableReal.diskSpace.description=
\u
041E
\u0431\u0449\u0435\u0435
\u0434\u0438\u0441\u
043A
\u
043E
\u0432\u
043E
\u0435
\u
043F
\u0440\u
043E
\u0441\u0442\u0440\u0430\u
043D
\u0441\u0442\u0432\u
043E,
\u0438\u0441\u
043F
\u
043E
\u
043B
\u
044C
\u0437\u0443\u0435\u
043C
\u
043E
\u0435
\u0443\u
043A
\u0430\u0437\u0430\u
043D
\u
043D
\u
043E
\u0439
\u0442\u0430\u0431\u
043B
\u0438\u0446\u0435\u0439
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTableReal.relationSize.name=
\u0420\u0435\u0430\u
043B
\u
044C
\u
043D
\u
044B
\u0439
\u0440\u0430\u0437\u
043C
\u0435\u0440
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTableReal.relationSize.description=
\u0414\u0438\u0441\u
043A
\u
043E
\u0432\u
043E
\u0435
\u
043F
\u0440\u
043E
\u0441\u0442\u0440\u0430\u
043D
\u0441\u0442\u0432\u
043E,
\u0438\u0441\u
043F
\u
043E
\u
043B
\u
044C
\u0437\u0443\u0435\u
043C
\u
043E
\u0435
fork 'main'
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablePartition.
partKeys.name=
\u
041A
\u
043B
\u
044E
\u0447\u0438
\u0441\u0435\u
043A
\u0446\u0438\u0438
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablePartition.
partKeys.description=Partition Keys -
\u
043A
\u
043B
\u
044E
\u0447\u0438
\u0441\u0435\u
043A
\u0446\u0438\u0438
/
\u0440\u0430\u0437\u0434\u0435\u
043B
\u0430
/
\u
043F
\u0430\u0440\u0442\u0438\u0446\u0438\u0438
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablePartition.
expr.name=
\u0412\u
044B
\u0440\u0430\u0436\u0435\u
043D
\u0438\u0435
\u0434\u
043B
\u
044F
\u
043F
\u0430\u0440\u0442\u0438
\u0446\u0438\u0438
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablePartition.
expr.description=
\u0412\u
044B
\u0440\u0430\u0436\u0435\u
043D
\u0438\u0435
\u
043F
\u
043E
\u
043A
\u0442\u
043E
\u0440\u
043E
\u
043C
\u0443
\u0441\u
043E
\u0437\u0434\u0430\u0432\u0430\u
043B
\u0430\u0441\u
044C
\u
043F
\u0430\u0440\u0442\u0438\u0446\u0438\u
044F
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablespace.name.name=
\u
041D
\u0430\u0437\u0432\u0430\u
043D
\u0438\u0435
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablespace.name.description=
meta.org.jkiss.dbeaver.ext.postgresql.model.PostgreTablespace.options.name=
\u
041D
\u0430\u0441\u0442\u0440\u
043E
\u0439\u
043A
\u0438
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreClass.java
浏览文件 @
e51f7dc4
...
...
@@ -35,6 +35,7 @@ public interface PostgreClass extends PostgreObject, DBSEntity, DBPRefreshableOb
public
static
final
RelKind
t
=
new
RelKind
(
"t"
);
// TOAST table
public
static
final
RelKind
f
=
new
RelKind
(
"f"
);
// = foreign table
public
static
final
RelKind
p
=
new
RelKind
(
"p"
);
// partitionedtable
public
static
final
RelKind
R
=
new
RelKind
(
"R"
);
// partition
// Redshift
public
static
final
RelKind
e
=
new
RelKind
(
"e"
);
public
static
final
RelKind
s
=
new
RelKind
(
"s"
);;
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreSchema.java
浏览文件 @
e51f7dc4
...
...
@@ -488,6 +488,9 @@ public class PostgreSchema implements DBSSchema, DBPNamedObject2, DBPSaveableObj
public
JDBCStatement
prepareLookupStatement
(
@NotNull
JDBCSession
session
,
@NotNull
PostgreSchema
postgreSchema
,
@Nullable
PostgreTableBase
object
,
@Nullable
String
objectName
)
throws
SQLException
{
StringBuilder
sql
=
new
StringBuilder
();
sql
.
append
(
"SELECT c.oid,c.*,d.description"
);
if
(
getDataSource
().
isServerVersionAtLeast
(
10
,
0
))
{
sql
.
append
(
",pg_catalog.pg_get_expr(c.relpartbound, c.oid) as partition_expr"
);
}
sql
.
append
(
"\nFROM pg_catalog.pg_class c\n"
)
.
append
(
"LEFT OUTER JOIN pg_catalog.pg_description d ON d.objoid=c.oid AND d.objsubid=0\n"
)
.
append
(
"WHERE c.relnamespace=? AND c.relkind not in ('i','c')"
)
...
...
@@ -503,7 +506,11 @@ public class PostgreSchema implements DBSSchema, DBPNamedObject2, DBPSaveableObj
protected
PostgreTableBase
fetchObject
(
@NotNull
JDBCSession
session
,
@NotNull
PostgreSchema
owner
,
@NotNull
JDBCResultSet
dbResult
)
throws
SQLException
,
DBException
{
final
String
kindString
=
JDBCUtils
.
safeGetString
(
dbResult
,
"relkind"
);
final
String
kindString
=
getDataSource
().
isServerVersionAtLeast
(
10
,
0
)
&&
JDBCUtils
.
safeGetString
(
dbResult
,
"relkind"
).
equals
(
PostgreClass
.
RelKind
.
r
.
getCode
())
&&
JDBCUtils
.
safeGetBoolean
(
dbResult
,
"relispartition"
)
?
PostgreClass
.
RelKind
.
R
.
getCode
()
:
JDBCUtils
.
safeGetString
(
dbResult
,
"relkind"
);
PostgreClass
.
RelKind
kind
=
PostgreClass
.
RelKind
.
valueOf
(
kindString
);
return
owner
.
getDataSource
().
getServerType
().
createRelationOfClass
(
PostgreSchema
.
this
,
kind
,
dbResult
);
}
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreTablePartition.java
浏览文件 @
e51f7dc4
...
...
@@ -19,6 +19,7 @@ package org.jkiss.dbeaver.ext.postgresql.model;
import
java.sql.ResultSet
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCUtils
;
import
org.jkiss.dbeaver.model.meta.Property
;
import
org.jkiss.dbeaver.model.struct.DBSEntity
;
...
...
@@ -27,16 +28,25 @@ public class PostgreTablePartition extends PostgreTable
public
static
final
String
CAT_PARTITIONING
=
"Partitioning"
;
private
String
expr
;
public
PostgreTablePartition
(
PostgreSchema
catalog
)
{
super
(
catalog
);
}
public
PostgreTablePartition
(
PostgreSchema
catalog
,
ResultSet
dbResult
)
{
super
(
catalog
,
dbResult
);
this
.
expr
=
JDBCUtils
.
safeGetString
(
dbResult
,
"partition_expr"
);
}
@Property
(
category
=
CAT_PARTITIONING
,
editable
=
false
,
viewable
=
true
,
order
=
90
)
public
String
getExpr
()
{
return
expr
;
}
/*
public PostgreTablePartition(PostgreSchema container, DBSEntity source, boolean persisted) {
super(container, source, persisted);
}
...
...
@@ -47,7 +57,7 @@ public class PostgreTablePartition extends PostgreTable
}
/*
private final PostgreTableBase partitionTable;
private int sequenceNum;
//select * from pg_partitioned_table where partrelid = ?
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/impls/PostgreServerExtensionBase.java
浏览文件 @
e51f7dc4
...
...
@@ -160,6 +160,8 @@ public abstract class PostgreServerExtensionBase implements PostgreServerExtensi
public
PostgreTableBase
createRelationOfClass
(
PostgreSchema
schema
,
PostgreClass
.
RelKind
kind
,
JDBCResultSet
dbResult
)
{
if
(
kind
==
PostgreClass
.
RelKind
.
r
)
{
return
new
PostgreTableRegular
(
schema
,
dbResult
);
}
else
if
(
kind
==
PostgreClass
.
RelKind
.
R
)
{
return
new
PostgreTablePartition
(
schema
,
dbResult
);
}
else
if
(
kind
==
PostgreClass
.
RelKind
.
v
)
{
return
new
PostgreView
(
schema
,
dbResult
);
}
else
if
(
kind
==
PostgreClass
.
RelKind
.
m
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录