Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
02c6e206
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
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,发现更多精彩内容 >>
提交
02c6e206
编写于
4月 12, 2016
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
PostgreSQL OIDs overflow fix
Former-commit-id:
a9e330b1
上级
5af64c69
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
85 addition
and
83 deletion
+85
-83
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreAttribute.java
.../jkiss/dbeaver/ext/postgresql/model/PostgreAttribute.java
+1
-1
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreCharset.java
...rg/jkiss/dbeaver/ext/postgresql/model/PostgreCharset.java
+2
-2
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreDataType.java
...g/jkiss/dbeaver/ext/postgresql/model/PostgreDataType.java
+21
-21
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreDatabase.java
...g/jkiss/dbeaver/ext/postgresql/model/PostgreDatabase.java
+11
-11
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreForeignDataWrapper.java
...eaver/ext/postgresql/model/PostgreForeignDataWrapper.java
+8
-8
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreForeignServer.java
...ss/dbeaver/ext/postgresql/model/PostgreForeignServer.java
+4
-4
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreIndex.java
.../org/jkiss/dbeaver/ext/postgresql/model/PostgreIndex.java
+2
-2
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreLanguage.java
...g/jkiss/dbeaver/ext/postgresql/model/PostgreLanguage.java
+3
-3
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreProcedure.java
.../jkiss/dbeaver/ext/postgresql/model/PostgreProcedure.java
+6
-6
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreSchema.java
...org/jkiss/dbeaver/ext/postgresql/model/PostgreSchema.java
+2
-2
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreStructureAssistant.java
...eaver/ext/postgresql/model/PostgreStructureAssistant.java
+6
-6
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreTable.java
.../org/jkiss/dbeaver/ext/postgresql/model/PostgreTable.java
+6
-6
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreTableForeign.java
...iss/dbeaver/ext/postgresql/model/PostgreTableForeign.java
+2
-2
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreTableForeignKey.java
.../dbeaver/ext/postgresql/model/PostgreTableForeignKey.java
+5
-3
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreTablespace.java
...jkiss/dbeaver/ext/postgresql/model/PostgreTablespace.java
+2
-2
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/session/PostgreSession.java
.../dbeaver/ext/postgresql/model/session/PostgreSession.java
+3
-3
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/session/PostgreSessionManager.java
...r/ext/postgresql/model/session/PostgreSessionManager.java
+1
-1
未找到文件。
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreAttribute.java
浏览文件 @
02c6e206
...
...
@@ -79,7 +79,7 @@ public abstract class PostgreAttribute<OWNER extends DBSEntity & PostgreObject>
setName
(
JDBCUtils
.
safeGetString
(
dbResult
,
"attname"
));
setOrdinalPosition
(
JDBCUtils
.
safeGetInt
(
dbResult
,
"attnum"
));
setRequired
(
JDBCUtils
.
safeGetBoolean
(
dbResult
,
"attnotnull"
));
final
int
typeId
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"atttypid"
);
final
long
typeId
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"atttypid"
);
dataType
=
getTable
().
getDatabase
().
getDataType
(
typeId
);
if
(
dataType
==
null
)
{
throw
new
DBException
(
"Attribute data type '"
+
typeId
+
"' not found"
);
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreCharset.java
浏览文件 @
02c6e206
...
...
@@ -29,7 +29,7 @@ import java.sql.SQLException;
*/
public
class
PostgreCharset
extends
PostgreInformation
{
private
int
encodingId
;
private
long
encodingId
;
private
String
name
;
public
PostgreCharset
(
PostgreDatabase
database
,
ResultSet
dbResult
)
...
...
@@ -43,7 +43,7 @@ public class PostgreCharset extends PostgreInformation {
throws
SQLException
{
this
.
name
=
JDBCUtils
.
safeGetString
(
dbResult
,
"encname"
);
this
.
encodingId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"encid"
);
this
.
encodingId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"encid"
);
}
@NotNull
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreDataType.java
浏览文件 @
02c6e206
...
...
@@ -72,17 +72,17 @@ public class PostgreDataType extends JDBCDataType<PostgreSchema> implements Post
"regdictionary"
,
};
private
int
typeId
;
private
long
typeId
;
private
PostgreTypeType
typeType
;
private
PostgreTypeCategory
typeCategory
;
private
final
int
ownerId
;
private
final
long
ownerId
;
private
boolean
isByValue
;
private
boolean
isPreferred
;
private
String
arrayDelimiter
;
private
int
classId
;
private
int
elementTypeId
;
private
int
arrayItemTypeId
;
private
long
classId
;
private
long
elementTypeId
;
private
long
arrayItemTypeId
;
private
String
inputFunc
;
private
String
outputFunc
;
private
String
receiveFunc
;
...
...
@@ -93,16 +93,16 @@ public class PostgreDataType extends JDBCDataType<PostgreSchema> implements Post
private
PostgreTypeAlign
align
=
PostgreTypeAlign
.
c
;
private
PostgreTypeStorage
storage
=
PostgreTypeStorage
.
p
;
private
boolean
isNotNull
;
private
int
baseTypeId
;
private
long
baseTypeId
;
private
int
typeMod
;
private
int
arrayDim
;
private
int
collationId
;
private
long
collationId
;
private
String
defaultValue
;
private
final
AttributeCache
attributeCache
;
private
Object
[]
enumValues
;
public
PostgreDataType
(
@NotNull
JDBCSession
monitor
,
@NotNull
PostgreSchema
owner
,
int
typeId
,
int
valueType
,
String
name
,
int
length
,
JDBCResultSet
dbResult
)
throws
DBException
{
public
PostgreDataType
(
@NotNull
JDBCSession
monitor
,
@NotNull
PostgreSchema
owner
,
long
typeId
,
int
valueType
,
String
name
,
int
length
,
JDBCResultSet
dbResult
)
throws
DBException
{
super
(
owner
,
valueType
,
name
,
null
,
false
,
true
,
length
,
-
1
,
-
1
);
this
.
typeId
=
typeId
;
...
...
@@ -125,13 +125,13 @@ public class PostgreDataType extends JDBCDataType<PostgreSchema> implements Post
log
.
debug
(
e
);
}
this
.
ownerId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"typowner"
);
this
.
ownerId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"typowner"
);
this
.
isByValue
=
JDBCUtils
.
safeGetBoolean
(
dbResult
,
"typbyval"
);
this
.
isPreferred
=
JDBCUtils
.
safeGetBoolean
(
dbResult
,
"typispreferred"
);
this
.
arrayDelimiter
=
JDBCUtils
.
safeGetString
(
dbResult
,
"typdelim"
);
this
.
classId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"typrelid"
);
this
.
elementTypeId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"typelem"
);
this
.
arrayItemTypeId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"typarray"
);
this
.
classId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"typrelid"
);
this
.
elementTypeId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"typelem"
);
this
.
arrayItemTypeId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"typarray"
);
this
.
inputFunc
=
JDBCUtils
.
safeGetString
(
dbResult
,
"typinput"
);
this
.
outputFunc
=
JDBCUtils
.
safeGetString
(
dbResult
,
"typoutput"
);
this
.
receiveFunc
=
JDBCUtils
.
safeGetString
(
dbResult
,
"typreceive"
);
...
...
@@ -150,10 +150,10 @@ public class PostgreDataType extends JDBCDataType<PostgreSchema> implements Post
log
.
debug
(
e
);
}
this
.
isNotNull
=
JDBCUtils
.
safeGetBoolean
(
dbResult
,
"typnotnull"
);
this
.
baseTypeId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"typbasetype"
);
this
.
baseTypeId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"typbasetype"
);
this
.
typeMod
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"typtypmod"
);
this
.
arrayDim
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"typndims"
);
this
.
collationId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"typcollation"
);
this
.
collationId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"typcollation"
);
this
.
defaultValue
=
JDBCUtils
.
safeGetString
(
dbResult
,
"typdefault"
);
this
.
attributeCache
=
hasAttributes
()
?
new
AttributeCache
()
:
null
;
...
...
@@ -321,7 +321,7 @@ public class PostgreDataType extends JDBCDataType<PostgreSchema> implements Post
}
@Property
(
category
=
CAT_MODIFIERS
)
public
int
getCollationId
()
{
public
long
getCollationId
()
{
return
collationId
;
}
...
...
@@ -349,14 +349,14 @@ public class PostgreDataType extends JDBCDataType<PostgreSchema> implements Post
return
typeType
==
PostgreTypeType
.
c
&&
classId
>=
0
;
}
private
PostgreDataType
resolveType
(
int
typeId
)
{
private
PostgreDataType
resolveType
(
long
typeId
)
{
return
getDatabase
().
getDataType
(
typeId
);
}
public
static
PostgreDataType
readDataType
(
@NotNull
JDBCSession
session
,
@NotNull
PostgreSchema
schema
,
@NotNull
JDBCResultSet
dbResult
)
throws
SQLException
,
DBException
{
int
schemaId
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"typnamespace"
);
int
typeId
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"oid"
);
//long schemaId = JDBCUtils.safeGetLong
(dbResult, "typnamespace");
long
typeId
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"oid"
);
String
name
=
JDBCUtils
.
safeGetString
(
dbResult
,
"typname"
);
if
(
CommonUtils
.
isEmpty
(
name
))
{
return
null
;
...
...
@@ -379,9 +379,9 @@ public class PostgreDataType extends JDBCDataType<PostgreSchema> implements Post
valueType
=
Types
.
VARCHAR
;
}
else
{
if
(
typeCategory
==
null
)
{
final
int
typElem
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"typelem"
);
final
long
typElem
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"typelem"
);
// In old PostgreSQL versions
switch
(
typeId
)
{
switch
(
(
int
)
typeId
)
{
case
PostgreOid
.
BIT
:
valueType
=
Types
.
BIT
;
break
;
...
...
@@ -590,7 +590,7 @@ public class PostgreDataType extends JDBCDataType<PostgreSchema> implements Post
"\nLEFT OUTER JOIN pg_catalog.pg_description dsc ON (c.oid=dsc.objoid AND a.attnum = dsc.objsubid)"
+
"\nWHERE a.attnum > 0 AND NOT a.attisdropped AND c.oid=?"
+
"\nORDER BY a.attnum"
);
dbStat
.
set
Int
(
1
,
postgreDataType
.
classId
);
dbStat
.
set
Long
(
1
,
postgreDataType
.
classId
);
return
dbStat
;
}
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreDatabase.java
浏览文件 @
02c6e206
...
...
@@ -41,7 +41,7 @@ import org.jkiss.dbeaver.model.meta.Property;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.struct.*
;
import
org.jkiss.dbeaver.model.struct.rdb.DBSCatalog
;
import
org.jkiss.utils.
Int
KeyMap
;
import
org.jkiss.utils.
Long
KeyMap
;
import
java.sql.SQLException
;
import
java.util.Collection
;
...
...
@@ -58,14 +58,14 @@ public class PostgreDatabase implements DBSInstance, DBSCatalog, DBPRefreshableO
private
PostgreDataSource
dataSource
;
private
long
oid
;
private
String
name
;
private
int
ownerId
;
private
int
encodingId
;
private
long
ownerId
;
private
long
encodingId
;
private
String
collate
;
private
String
ctype
;
private
boolean
isTemplate
;
private
boolean
allowConnect
;
private
int
connectionLimit
;
private
int
tablespaceId
;
private
long
tablespaceId
;
public
final
AuthIdCache
authIdCache
=
new
AuthIdCache
();
public
final
AccessMethodCache
accessMethodCache
=
new
AccessMethodCache
();
...
...
@@ -75,7 +75,7 @@ public class PostgreDatabase implements DBSInstance, DBSCatalog, DBPRefreshableO
public
final
EncodingCache
encodingCache
=
new
EncodingCache
();
public
final
TablespaceCache
tablespaceCache
=
new
TablespaceCache
();
public
final
SchemaCache
schemaCache
=
new
SchemaCache
();
public
final
IntKeyMap
<
PostgreDataType
>
dataTypeCache
=
new
Int
KeyMap
<>();
public
final
LongKeyMap
<
PostgreDataType
>
dataTypeCache
=
new
Long
KeyMap
<>();
public
PostgreDatabase
(
PostgreDataSource
dataSource
,
JDBCResultSet
dbResult
)
throws
SQLException
...
...
@@ -89,14 +89,14 @@ public class PostgreDatabase implements DBSInstance, DBSCatalog, DBPRefreshableO
{
this
.
oid
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"oid"
);
this
.
name
=
JDBCUtils
.
safeGetString
(
dbResult
,
"datname"
);
this
.
ownerId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"datdba"
);
this
.
encodingId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"encoding"
);
this
.
ownerId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"datdba"
);
this
.
encodingId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"encoding"
);
this
.
collate
=
JDBCUtils
.
safeGetString
(
dbResult
,
"datcollate"
);
this
.
ctype
=
JDBCUtils
.
safeGetString
(
dbResult
,
"datctype"
);
this
.
isTemplate
=
JDBCUtils
.
safeGetBoolean
(
dbResult
,
"datistemplate"
);
this
.
allowConnect
=
JDBCUtils
.
safeGetBoolean
(
dbResult
,
"datallowconn"
);
this
.
connectionLimit
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"datconnlimit"
);
this
.
tablespaceId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"dattablespace"
);
this
.
tablespaceId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"dattablespace"
);
}
@NotNull
...
...
@@ -297,7 +297,7 @@ public class PostgreDatabase implements DBSInstance, DBSCatalog, DBPRefreshableO
return
null
;
}
PostgreTableBase
findTable
(
DBRProgressMonitor
monitor
,
int
schemaId
,
int
tableId
)
PostgreTableBase
findTable
(
DBRProgressMonitor
monitor
,
long
schemaId
,
long
tableId
)
throws
DBException
{
PostgreSchema
schema
=
getSchema
(
monitor
,
schemaId
);
...
...
@@ -395,7 +395,7 @@ public class PostgreDatabase implements DBSInstance, DBSCatalog, DBPRefreshableO
}
}
public
PostgreProcedure
getProcedure
(
DBRProgressMonitor
monitor
,
int
schemaId
,
int
procId
)
public
PostgreProcedure
getProcedure
(
DBRProgressMonitor
monitor
,
long
schemaId
,
long
procId
)
throws
DBException
{
final
PostgreSchema
schema
=
getSchema
(
monitor
,
schemaId
);
...
...
@@ -405,7 +405,7 @@ public class PostgreDatabase implements DBSInstance, DBSCatalog, DBPRefreshableO
return
null
;
}
public
PostgreDataType
getDataType
(
int
typeId
)
{
public
PostgreDataType
getDataType
(
long
typeId
)
{
if
(
typeId
<=
0
)
{
return
null
;
}
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreForeignDataWrapper.java
浏览文件 @
02c6e206
...
...
@@ -35,10 +35,10 @@ public class PostgreForeignDataWrapper extends PostgreInformation {
private
long
oid
;
private
String
name
;
private
String
[]
options
;
private
int
ownerId
;
private
int
handlerProcId
;
private
int
validatorProcId
;
private
int
handlerSchemaId
;
private
long
ownerId
;
private
long
handlerProcId
;
private
long
validatorProcId
;
private
long
handlerSchemaId
;
public
PostgreForeignDataWrapper
(
PostgreDatabase
database
,
ResultSet
dbResult
)
throws
SQLException
...
...
@@ -52,10 +52,10 @@ public class PostgreForeignDataWrapper extends PostgreInformation {
{
this
.
oid
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"oid"
);
this
.
name
=
JDBCUtils
.
safeGetString
(
dbResult
,
"fdwname"
);
this
.
ownerId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"fdwowner"
);
this
.
handlerProcId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"fdwhandler"
);
this
.
validatorProcId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"fdwvalidator"
);
this
.
handlerSchemaId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"handler_schema_id"
);
this
.
ownerId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"fdwowner"
);
this
.
handlerProcId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"fdwhandler"
);
this
.
validatorProcId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"fdwvalidator"
);
this
.
handlerSchemaId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"handler_schema_id"
);
this
.
options
=
JDBCUtils
.
safeGetArray
(
dbResult
,
"fdwoptions"
);
}
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreForeignServer.java
浏览文件 @
02c6e206
...
...
@@ -37,8 +37,8 @@ public class PostgreForeignServer extends PostgreInformation {
private
String
type
;
private
String
version
;
private
String
[]
options
;
private
int
ownerId
;
private
int
dataWrapperId
;
private
long
ownerId
;
private
long
dataWrapperId
;
public
PostgreForeignServer
(
PostgreDatabase
database
,
ResultSet
dbResult
)
throws
SQLException
...
...
@@ -52,8 +52,8 @@ public class PostgreForeignServer extends PostgreInformation {
{
this
.
oid
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"oid"
);
this
.
name
=
JDBCUtils
.
safeGetString
(
dbResult
,
"srvname"
);
this
.
ownerId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"srvowner"
);
this
.
dataWrapperId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"srvfdw"
);
this
.
ownerId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"srvowner"
);
this
.
dataWrapperId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"srvfdw"
);
this
.
type
=
JDBCUtils
.
safeGetString
(
dbResult
,
"srvtype"
);
this
.
version
=
JDBCUtils
.
safeGetString
(
dbResult
,
"srvversion"
);
this
.
options
=
JDBCUtils
.
safeGetArray
(
dbResult
,
"srvoptions"
);
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreIndex.java
浏览文件 @
02c6e206
...
...
@@ -48,7 +48,7 @@ public class PostgreIndex extends JDBCTableIndex<PostgreSchema, PostgreTableBase
private
boolean
isReady
;
private
String
description
;
private
List
<
PostgreIndexColumn
>
columns
=
new
ArrayList
<>();
private
int
amId
;
private
long
amId
;
public
PostgreIndex
(
PostgreTableBase
parent
,
String
indexName
,
ResultSet
dbResult
)
{
super
(
...
...
@@ -67,7 +67,7 @@ public class PostgreIndex extends JDBCTableIndex<PostgreSchema, PostgreTableBase
this
.
isReady
=
JDBCUtils
.
safeGetBoolean
(
dbResult
,
"indisready"
);
this
.
description
=
JDBCUtils
.
safeGetString
(
dbResult
,
"description"
);
this
.
amId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"relam"
);
this
.
amId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"relam"
);
}
public
PostgreIndex
(
PostgreTableBase
parent
,
String
name
,
DBSIndexType
indexType
)
{
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreLanguage.java
浏览文件 @
02c6e206
...
...
@@ -31,7 +31,7 @@ public class PostgreLanguage extends PostgreInformation {
private
long
oid
;
private
String
name
;
private
int
ownerId
;
private
long
ownerId
;
private
boolean
userDefined
;
private
boolean
trusted
;
private
String
handlerId
;
...
...
@@ -50,7 +50,7 @@ public class PostgreLanguage extends PostgreInformation {
{
this
.
oid
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"oid"
);
this
.
name
=
JDBCUtils
.
safeGetString
(
dbResult
,
"lanname"
);
this
.
ownerId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"lanowner"
);
this
.
ownerId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"lanowner"
);
this
.
userDefined
=
JDBCUtils
.
safeGetBoolean
(
dbResult
,
"lanispl"
);
this
.
trusted
=
JDBCUtils
.
safeGetBoolean
(
dbResult
,
"lanpltrusted"
);
this
.
handlerId
=
JDBCUtils
.
safeGetString
(
dbResult
,
"lanplcallfoid"
);
...
...
@@ -73,7 +73,7 @@ public class PostgreLanguage extends PostgreInformation {
}
@Property
(
viewable
=
true
,
order
=
3
)
public
int
getOwnerId
()
{
public
long
getOwnerId
()
{
return
ownerId
;
}
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreProcedure.java
浏览文件 @
02c6e206
...
...
@@ -77,8 +77,8 @@ public class PostgreProcedure extends AbstractProcedure<PostgreDataSource, Postg
private
long
oid
;
private
String
procSrc
;
private
String
body
;
private
int
ownerId
;
private
int
languageId
;
private
long
ownerId
;
private
long
languageId
;
private
float
execCost
;
private
float
estRows
;
private
PostgreDataType
varArrayType
;
...
...
@@ -113,8 +113,8 @@ public class PostgreProcedure extends AbstractProcedure<PostgreDataSource, Postg
private
void
loadInfo
(
ResultSet
dbResult
)
{
this
.
oid
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"oid"
);
setName
(
JDBCUtils
.
safeGetString
(
dbResult
,
"proname"
));
this
.
ownerId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"proowner"
);
this
.
languageId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"prolang"
);
this
.
ownerId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"proowner"
);
this
.
languageId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"prolang"
);
this
.
execCost
=
JDBCUtils
.
safeGetFloat
(
dbResult
,
"procost"
);
this
.
estRows
=
JDBCUtils
.
safeGetFloat
(
dbResult
,
"prorows"
);
...
...
@@ -182,7 +182,7 @@ public class PostgreProcedure extends AbstractProcedure<PostgreDataSource, Postg
}
{
final
int
varTypeId
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"provariadic"
);
final
long
varTypeId
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"provariadic"
);
if
(
varTypeId
!=
0
)
{
varArrayType
=
container
.
getDatabase
().
getDataType
(
varTypeId
);
}
...
...
@@ -200,7 +200,7 @@ public class PostgreProcedure extends AbstractProcedure<PostgreDataSource, Postg
log
.
debug
(
e
);
}
{
final
int
retTypeId
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"prorettype"
);
final
long
retTypeId
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"prorettype"
);
if
(
retTypeId
!=
0
)
{
returnType
=
container
.
getDatabase
().
getDataType
(
retTypeId
);
}
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreSchema.java
浏览文件 @
02c6e206
...
...
@@ -92,7 +92,7 @@ public class PostgreSchema implements DBSSchema, DBPSaveableObject, DBPRefreshab
throws
SQLException
{
this
.
oid
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"oid"
);
this
.
ownerId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"nspowner"
);
this
.
ownerId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"nspowner"
);
this
.
persisted
=
true
;
}
...
...
@@ -171,7 +171,7 @@ public class PostgreSchema implements DBSSchema, DBPSaveableObject, DBPRefreshab
return
indexCache
.
getObjects
(
monitor
,
this
,
null
);
}
public
PostgreTableBase
getTable
(
DBRProgressMonitor
monitor
,
int
tableId
)
public
PostgreTableBase
getTable
(
DBRProgressMonitor
monitor
,
long
tableId
)
throws
DBException
{
for
(
PostgreClass
table
:
tableCache
.
getAllObjects
(
monitor
,
this
))
{
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreStructureAssistant.java
浏览文件 @
02c6e206
...
...
@@ -138,8 +138,8 @@ public class PostgreStructureAssistant extends JDBCStructureAssistant
if
(
monitor
.
isCanceled
())
{
break
;
}
final
int
schemaId
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"relnamespace"
);
final
int
tableId
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"oid"
);
final
long
schemaId
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"relnamespace"
);
final
long
tableId
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"oid"
);
final
String
tableName
=
JDBCUtils
.
safeGetString
(
dbResult
,
"relname"
);
final
PostgreSchema
tableSchema
=
dataSource
.
getDefaultInstance
().
getSchema
(
session
.
getProgressMonitor
(),
schemaId
);
objects
.
add
(
new
AbstractObjectReference
(
tableName
,
tableSchema
,
null
,
RelationalObjectType
.
TYPE_TABLE
)
{
...
...
@@ -178,8 +178,8 @@ public class PostgreStructureAssistant extends JDBCStructureAssistant
if
(
monitor
.
isCanceled
())
{
break
;
}
final
int
schemaId
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"pronamespace"
);
final
int
procId
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"oid"
);
final
long
schemaId
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"pronamespace"
);
final
long
procId
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"oid"
);
final
String
procName
=
JDBCUtils
.
safeGetString
(
dbResult
,
"proname"
);
final
PostgreSchema
procSchema
=
dataSource
.
getDefaultInstance
().
getSchema
(
session
.
getProgressMonitor
(),
schemaId
);
objects
.
add
(
new
AbstractObjectReference
(
procName
,
procSchema
,
null
,
RelationalObjectType
.
TYPE_PROCEDURE
)
{
...
...
@@ -218,8 +218,8 @@ public class PostgreStructureAssistant extends JDBCStructureAssistant
if
(
monitor
.
isCanceled
())
{
break
;
}
final
int
schemaId
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"connamespace"
);
final
int
constrId
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"oid"
);
final
long
schemaId
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"connamespace"
);
final
long
constrId
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"oid"
);
final
String
constrName
=
JDBCUtils
.
safeGetString
(
dbResult
,
"conname"
);
final
PostgreSchema
constrSchema
=
dataSource
.
getDefaultInstance
().
getSchema
(
session
.
getProgressMonitor
(),
schemaId
);
objects
.
add
(
new
AbstractObjectReference
(
constrName
,
constrSchema
,
null
,
RelationalObjectType
.
TYPE_TABLE
)
{
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreTable.java
浏览文件 @
02c6e206
...
...
@@ -51,7 +51,7 @@ public abstract class PostgreTable extends PostgreTableReal implements DBDPseudo
private
SimpleObjectCache
<
PostgreTable
,
PostgreTableForeignKey
>
foreignKeys
=
new
SimpleObjectCache
<>();
private
boolean
hasOids
;
private
int
tablespaceId
;
private
long
tablespaceId
;
private
List
<
PostgreTableInheritance
>
superTables
;
private
List
<
PostgreTableInheritance
>
subTables
;
...
...
@@ -67,7 +67,7 @@ public abstract class PostgreTable extends PostgreTableReal implements DBDPseudo
super
(
catalog
,
dbResult
);
this
.
hasOids
=
JDBCUtils
.
safeGetBoolean
(
dbResult
,
"relhasoids"
);
this
.
tablespaceId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"reltablespace"
);
this
.
tablespaceId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"reltablespace"
);
}
public
SimpleObjectCache
<
PostgreTable
,
PostgreTableForeignKey
>
getForeignKeyCache
()
{
...
...
@@ -199,8 +199,8 @@ public abstract class PostgreTable extends PostgreTableReal implements DBDPseudo
dbStat
.
setLong
(
1
,
getObjectId
());
try
(
JDBCResultSet
dbResult
=
dbStat
.
executeQuery
())
{
while
(
dbResult
.
next
())
{
final
int
parentSchemaId
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"relnamespace"
);
final
int
parentTableId
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"inhparent"
);
final
long
parentSchemaId
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"relnamespace"
);
final
long
parentTableId
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"inhparent"
);
PostgreSchema
schema
=
getDatabase
().
getSchema
(
monitor
,
parentSchemaId
);
if
(
schema
==
null
)
{
log
.
warn
(
"Can't find parent table's schema '"
+
parentSchemaId
+
"'"
);
...
...
@@ -244,8 +244,8 @@ public abstract class PostgreTable extends PostgreTableReal implements DBDPseudo
dbStat
.
setLong
(
1
,
getObjectId
());
try
(
JDBCResultSet
dbResult
=
dbStat
.
executeQuery
())
{
while
(
dbResult
.
next
())
{
final
int
subSchemaId
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"relnamespace"
);
final
int
subTableId
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"inhrelid"
);
final
long
subSchemaId
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"relnamespace"
);
final
long
subTableId
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"inhrelid"
);
PostgreSchema
schema
=
getDatabase
().
getSchema
(
monitor
,
subSchemaId
);
if
(
schema
==
null
)
{
log
.
warn
(
"Can't find sub-table's schema '"
+
subSchemaId
+
"'"
);
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreTableForeign.java
浏览文件 @
02c6e206
...
...
@@ -40,7 +40,7 @@ import java.sql.SQLException;
*/
public
class
PostgreTableForeign
extends
PostgreTable
implements
DBPImageProvider
{
private
int
foreignServerId
;
private
long
foreignServerId
;
private
String
[]
foreignOptions
;
public
PostgreTableForeign
(
PostgreSchema
catalog
)
...
...
@@ -76,7 +76,7 @@ public class PostgreTableForeign extends PostgreTable implements DBPImageProvide
stat
.
setLong
(
1
,
getObjectId
());
try
(
JDBCResultSet
result
=
stat
.
executeQuery
())
{
if
(
result
.
next
())
{
foreignServerId
=
JDBCUtils
.
safeGet
Int
(
result
,
"ftserver"
);
foreignServerId
=
JDBCUtils
.
safeGet
Long
(
result
,
"ftserver"
);
foreignOptions
=
JDBCUtils
.
safeGetArray
(
result
,
"ftoptions"
);
}
}
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreTableForeignKey.java
浏览文件 @
02c6e206
...
...
@@ -55,8 +55,8 @@ public class PostgreTableForeignKey extends PostgreTableConstraintBase implement
deleteRule
=
getRuleFromAction
(
JDBCUtils
.
safeGetString
(
resultSet
,
"confdeltype"
));
final
DBRProgressMonitor
monitor
=
resultSet
.
getSession
().
getProgressMonitor
();
final
int
refSchemaId
=
JDBCUtils
.
safeGetInt
(
resultSet
,
"refnamespace"
);
final
int
refTableId
=
JDBCUtils
.
safeGetInt
(
resultSet
,
"confrelid"
);
final
long
refSchemaId
=
JDBCUtils
.
safeGetLong
(
resultSet
,
"refnamespace"
);
final
long
refTableId
=
JDBCUtils
.
safeGetLong
(
resultSet
,
"confrelid"
);
refTable
=
table
.
getDatabase
().
findTable
(
monitor
,
refSchemaId
,
...
...
@@ -134,7 +134,9 @@ public class PostgreTableForeignKey extends PostgreTableConstraintBase implement
columns
.
addAll
((
Collection
<?
extends
PostgreTableForeignKeyColumn
>)
children
);
final
List
<
PostgreAttribute
>
lst
=
new
ArrayList
<>(
children
.
size
());
for
(
PostgreTableConstraintColumn
c
:
children
)
lst
.
add
(((
PostgreTableForeignKeyColumn
)
c
).
getReferencedColumn
());
for
(
PostgreTableConstraintColumn
c
:
children
)
{
lst
.
add
(((
PostgreTableForeignKeyColumn
)
c
).
getReferencedColumn
());
}
try
{
refConstraint
=
DBUtils
.
findEntityConstraint
(
monitor
,
refTable
,
lst
);
}
catch
(
DBException
e
)
{
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreTablespace.java
浏览文件 @
02c6e206
...
...
@@ -34,7 +34,7 @@ public class PostgreTablespace extends PostgreInformation {
private
long
oid
;
private
String
name
;
private
int
ownerId
;
private
long
ownerId
;
private
Object
[]
options
;
public
PostgreTablespace
(
PostgreDatabase
database
,
ResultSet
dbResult
)
...
...
@@ -49,7 +49,7 @@ public class PostgreTablespace extends PostgreInformation {
{
this
.
oid
=
JDBCUtils
.
safeGetLong
(
dbResult
,
"oid"
);
this
.
name
=
JDBCUtils
.
safeGetString
(
dbResult
,
"spcname"
);
this
.
ownerId
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"spcowner"
);
this
.
ownerId
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"spcowner"
);
this
.
options
=
JDBCUtils
.
safeGetArray
(
dbResult
,
"spcoptions"
);
}
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/session/PostgreSession.java
浏览文件 @
02c6e206
...
...
@@ -32,7 +32,7 @@ public class PostgreSession implements DBAServerSession {
private
static
final
String
CAT_CLIENT
=
"Client"
;
private
static
final
String
CAT_TIMING
=
"Timings"
;
private
int
pid
;
private
long
pid
;
private
String
user
;
private
String
clientHost
;
private
String
clientPort
;
...
...
@@ -46,7 +46,7 @@ public class PostgreSession implements DBAServerSession {
private
String
appName
;
public
PostgreSession
(
ResultSet
dbResult
)
{
this
.
pid
=
JDBCUtils
.
safeGet
Int
(
dbResult
,
"pid"
);
this
.
pid
=
JDBCUtils
.
safeGet
Long
(
dbResult
,
"pid"
);
this
.
user
=
JDBCUtils
.
safeGetString
(
dbResult
,
"usename"
);
this
.
clientHost
=
JDBCUtils
.
safeGetString
(
dbResult
,
"client_hostname"
);
if
(
CommonUtils
.
isEmpty
(
this
.
clientHost
))
{
...
...
@@ -66,7 +66,7 @@ public class PostgreSession implements DBAServerSession {
}
@Property
(
viewable
=
true
,
order
=
1
)
public
int
getPid
()
public
long
getPid
()
{
return
pid
;
}
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/session/PostgreSessionManager.java
浏览文件 @
02c6e206
...
...
@@ -75,7 +75,7 @@ public class PostgreSessionManager implements DBAServerSessionManager<PostgreSes
{
try
{
try
(
JDBCPreparedStatement
dbStat
=
((
JDBCSession
)
session
).
prepareStatement
(
"SELECT pg_catalog.pg_terminate_backend(?)"
))
{
dbStat
.
set
Int
(
1
,
sessionType
.
getPid
());
dbStat
.
set
Long
(
1
,
sessionType
.
getPid
());
dbStat
.
execute
();
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录