Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
edf3d1d9
提交
edf3d1d9
authored
6月 19, 2011
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
PgServer: non-admin users could not open a database.
上级
f67db592
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
18 行增加
和
1 行删除
+18
-1
pg_catalog.sql
h2/src/main/org/h2/server/pg/pg_catalog.sql
+18
-1
没有找到文件。
h2/src/main/org/h2/server/pg/pg_catalog.sql
浏览文件 @
edf3d1d9
...
@@ -15,6 +15,7 @@ drop alias if exists pg_get_oid;
...
@@ -15,6 +15,7 @@ drop alias if exists pg_get_oid;
create
alias
pg_get_oid
deterministic
for
"org.h2.server.pg.PgServer.getOid"
;
create
alias
pg_get_oid
deterministic
for
"org.h2.server.pg.PgServer.getOid"
;
create
table
pg_catalog
.
pg_version
as
select
2
as
version
,
2
as
version_read
;
create
table
pg_catalog
.
pg_version
as
select
2
as
version
,
2
as
version_read
;
grant
select
on
pg_catalog
.
pg_version
to
public
;
create
view
pg_catalog
.
pg_roles
-- (oid, rolname, rolcreaterole, rolcreatedb)
create
view
pg_catalog
.
pg_roles
-- (oid, rolname, rolcreaterole, rolcreatedb)
as
as
...
@@ -24,6 +25,7 @@ select
...
@@ -24,6 +25,7 @@ select
case
when
admin
then
't'
else
'f'
end
as
rolcreaterole
,
case
when
admin
then
't'
else
'f'
end
as
rolcreaterole
,
case
when
admin
then
't'
else
'f'
end
as
rolcreatedb
case
when
admin
then
't'
else
'f'
end
as
rolcreatedb
from
information_schema
.
users
;
from
information_schema
.
users
;
grant
select
on
pg_catalog
.
pg_roles
to
public
;
create
view
pg_catalog
.
pg_namespace
-- (oid, nspname)
create
view
pg_catalog
.
pg_namespace
-- (oid, nspname)
as
as
...
@@ -31,6 +33,7 @@ select
...
@@ -31,6 +33,7 @@ select
id
oid
,
id
oid
,
cast
(
schema_name
as
varchar_ignorecase
)
nspname
cast
(
schema_name
as
varchar_ignorecase
)
nspname
from
information_schema
.
schemata
;
from
information_schema
.
schemata
;
grant
select
on
pg_catalog
.
pg_namespace
to
public
;
create
table
pg_catalog
.
pg_type
(
create
table
pg_catalog
.
pg_type
(
oid
int
primary
key
,
oid
int
primary
key
,
...
@@ -40,6 +43,7 @@ create table pg_catalog.pg_type(
...
@@ -40,6 +43,7 @@ create table pg_catalog.pg_type(
typtype
varchar
,
typtype
varchar
,
typbasetype
int
,
typbasetype
int
,
typtypmod
int
);
typtypmod
int
);
grant
select
on
pg_catalog
.
pg_type
to
public
;
insert
into
pg_catalog
.
pg_type
insert
into
pg_catalog
.
pg_type
select
select
...
@@ -107,6 +111,7 @@ select
...
@@ -107,6 +111,7 @@ select
false
relhasrules
,
false
relhasrules
,
false
relhasoids
false
relhasoids
from
information_schema
.
indexes
;
from
information_schema
.
indexes
;
grant
select
on
pg_catalog
.
pg_class
to
public
;
create
table
pg_catalog
.
pg_proc
(
create
table
pg_catalog
.
pg_proc
(
oid
int
,
oid
int
,
...
@@ -114,6 +119,7 @@ create table pg_catalog.pg_proc(
...
@@ -114,6 +119,7 @@ create table pg_catalog.pg_proc(
prorettype
int
,
prorettype
int
,
pronamespace
int
pronamespace
int
);
);
grant
select
on
pg_catalog
.
pg_proc
to
public
;
create
table
pg_catalog
.
pg_trigger
(
create
table
pg_catalog
.
pg_trigger
(
oid
int
,
oid
int
,
...
@@ -126,6 +132,7 @@ create table pg_catalog.pg_trigger(
...
@@ -126,6 +132,7 @@ create table pg_catalog.pg_trigger(
tgconstrname
varchar_ignorecase
,
tgconstrname
varchar_ignorecase
,
tgrelid
int
tgrelid
int
);
);
grant
select
on
pg_catalog
.
pg_trigger
to
public
;
create
view
pg_catalog
.
pg_attrdef
-- (oid, adsrc, adrelid, adnum)
create
view
pg_catalog
.
pg_attrdef
-- (oid, adsrc, adrelid, adnum)
as
as
...
@@ -135,6 +142,7 @@ select
...
@@ -135,6 +142,7 @@ select
0
adrelid
,
0
adrelid
,
0
adnum
0
adnum
from
information_schema
.
tables
where
1
=
0
;
from
information_schema
.
tables
where
1
=
0
;
grant
select
on
pg_catalog
.
pg_attrdef
to
public
;
create
view
pg_catalog
.
pg_attribute
-- (oid, attrelid, attname, atttypid, attlen, attnum, atttypmod, attnotnull, attisdropped, atthasdef)
create
view
pg_catalog
.
pg_attribute
-- (oid, attrelid, attname, atttypid, attlen, attnum, atttypmod, attnotnull, attisdropped, atthasdef)
as
as
...
@@ -169,6 +177,7 @@ where t.table_name = i.table_name
...
@@ -169,6 +177,7 @@ where t.table_name = i.table_name
and
t
.
table_schema
=
i
.
table_schema
and
t
.
table_schema
=
i
.
table_schema
and
t
.
table_name
=
c
.
table_name
and
t
.
table_name
=
c
.
table_name
and
t
.
table_schema
=
c
.
table_schema
;
and
t
.
table_schema
=
c
.
table_schema
;
grant
select
on
pg_catalog
.
pg_attribute
to
public
;
create
view
pg_catalog
.
pg_index
-- (oid, indexrelid, indrelid, indisclustered, indisunique, indisprimary, indexprs, indkey)
create
view
pg_catalog
.
pg_index
-- (oid, indexrelid, indrelid, indisclustered, indisunique, indisprimary, indexprs, indkey)
as
as
...
@@ -187,6 +196,7 @@ and i.table_name = t.table_name
...
@@ -187,6 +196,7 @@ and i.table_name = t.table_name
and
i
.
ordinal_position
=
1
and
i
.
ordinal_position
=
1
-- workaround for MS Access problem opening tables with primary key
-- workaround for MS Access problem opening tables with primary key
and
1
=
0
;
and
1
=
0
;
grant
select
on
pg_catalog
.
pg_index
to
public
;
drop
alias
if
exists
pg_get_indexdef
;
drop
alias
if
exists
pg_get_indexdef
;
create
alias
pg_get_indexdef
for
"org.h2.server.pg.PgServer.getIndexColumn"
;
create
alias
pg_get_indexdef
for
"org.h2.server.pg.PgServer.getIndexColumn"
;
...
@@ -226,6 +236,7 @@ create table pg_catalog.pg_database(
...
@@ -226,6 +236,7 @@ create table pg_catalog.pg_database(
datdba
int
,
datdba
int
,
dattablespace
int
dattablespace
int
);
);
grant
select
on
pg_catalog
.
pg_database
to
public
;
insert
into
pg_catalog
.
pg_database
values
(
insert
into
pg_catalog
.
pg_database
values
(
0
,
-- oid
0
,
-- oid
...
@@ -246,6 +257,7 @@ create table pg_catalog.pg_tablespace(
...
@@ -246,6 +257,7 @@ create table pg_catalog.pg_tablespace(
spcowner
int
,
spcowner
int
,
spcacl
array
-- aclitem[]
spcacl
array
-- aclitem[]
);
);
grant
select
on
pg_catalog
.
pg_tablespace
to
public
;
insert
into
pg_catalog
.
pg_tablespace
values
(
insert
into
pg_catalog
.
pg_tablespace
values
(
0
,
0
,
...
@@ -260,6 +272,7 @@ create table pg_catalog.pg_settings(
...
@@ -260,6 +272,7 @@ create table pg_catalog.pg_settings(
name
varchar_ignorecase
,
name
varchar_ignorecase
,
setting
varchar_ignorecase
setting
varchar_ignorecase
);
);
grant
select
on
pg_catalog
.
pg_settings
to
public
;
insert
into
pg_catalog
.
pg_settings
values
insert
into
pg_catalog
.
pg_settings
values
(
0
,
'autovacuum'
,
'on'
),
(
0
,
'autovacuum'
,
'on'
),
...
@@ -274,6 +287,7 @@ select
...
@@ -274,6 +287,7 @@ select
true
usecreatedb
,
true
usecreatedb
,
true
usesuper
true
usesuper
from
information_schema
.
users
;
from
information_schema
.
users
;
grant
select
on
pg_catalog
.
pg_user
to
public
;
create
table
pg_catalog
.
pg_authid
(
create
table
pg_catalog
.
pg_authid
(
oid
int
,
oid
int
,
...
@@ -289,8 +303,10 @@ create table pg_catalog.pg_authid(
...
@@ -289,8 +303,10 @@ create table pg_catalog.pg_authid(
rolvaliduntil
timestamp
,
-- timestamptz
rolvaliduntil
timestamp
,
-- timestamptz
rolconfig
array
-- text[]
rolconfig
array
-- text[]
);
);
grant
select
on
pg_catalog
.
pg_authid
to
public
;
create
table
pg_catalog
.
pg_am
(
oid
int
,
amname
varchar_ignorecase
);
create
table
pg_catalog
.
pg_am
(
oid
int
,
amname
varchar_ignorecase
);
grant
select
on
pg_catalog
.
pg_am
to
public
;
insert
into
pg_catalog
.
pg_am
values
(
0
,
'btree'
);
insert
into
pg_catalog
.
pg_am
values
(
0
,
'btree'
);
insert
into
pg_catalog
.
pg_am
values
(
1
,
'hash'
);
insert
into
pg_catalog
.
pg_am
values
(
1
,
'hash'
);
...
@@ -302,6 +318,7 @@ select
...
@@ -302,6 +318,7 @@ select
-
1
classoid
,
-
1
classoid
,
cast
(
datname
as
varchar_ignorecase
)
description
cast
(
datname
as
varchar_ignorecase
)
description
from
pg_catalog
.
pg_database
;
from
pg_catalog
.
pg_database
;
grant
select
on
pg_catalog
.
pg_description
to
public
;
create
table
pg_catalog
.
pg_group
-- oid, groname
create
table
pg_catalog
.
pg_group
-- oid, groname
as
as
...
@@ -309,4 +326,4 @@ select
...
@@ -309,4 +326,4 @@ select
0
oid
,
0
oid
,
cast
(
''
as
varchar_ignorecase
)
groname
cast
(
''
as
varchar_ignorecase
)
groname
from
pg_catalog
.
pg_database
where
1
=
0
;
from
pg_catalog
.
pg_database
where
1
=
0
;
grant
select
on
pg_catalog
.
pg_group
to
public
;
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论