Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit395c816

Browse files
committed
Sequences were not being shown due to the use of lowercase 's' instead
of 'S', and the views were not checking for table visibility withregards to temporary tables and sequences.Greg Sabino Mullane
1 parent19dd2fb commit395c816

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

‎src/backend/catalog/information_schema.sql

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright (c) 2003-2006, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.33 2006/04/02 17:38:13 petere Exp $
7+
* $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.34 2006/09/04 21:03:18 momjian Exp $
88
*/
99

1010
/*
@@ -644,7 +644,7 @@ CREATE VIEW columns AS
644644
WHEREa.attrelid=c.oid
645645
ANDa.atttypid=t.oid
646646
ANDnc.oid=c.relnamespace
647-
647+
AND (nc.nspname NOTLIKE'pg!_temp!_%' ESCAPE'!'ORpg_catalog.pg_table_is_visible(c.oid))
648648
ANDa.attnum>0AND NOTa.attisdroppedANDc.relkindin ('r','v')
649649

650650
AND (pg_has_role(c.relowner,'USAGE')
@@ -933,6 +933,7 @@ CREATE VIEW key_column_usage AS
933933
ANDnc.oid=c.connamespace
934934
ANDc.contypeIN ('p','u','f')
935935
ANDr.relkind='r'
936+
AND (nr.nspname NOTLIKE'pg!_temp!_%' ESCAPE'!'ORpg_catalog.pg_table_is_visible(r.oid))
936937
AND (pg_has_role(r.relowner,'USAGE')
937938
OR has_table_privilege(c.oid,'SELECT')
938939
OR has_table_privilege(c.oid,'INSERT')
@@ -1459,7 +1460,8 @@ CREATE VIEW sequences AS
14591460
CAST(nullAS character_data)AS cycle_option-- FIXME
14601461
FROM pg_namespace nc, pg_class c
14611462
WHEREc.relnamespace=nc.oid
1462-
ANDc.relkind='s'
1463+
ANDc.relkind='S'
1464+
AND (nc.nspname NOTLIKE'pg!_temp!_%' ESCAPE'!'ORpg_catalog.pg_table_is_visible(c.oid))
14631465
AND (pg_has_role(c.relowner,'USAGE')
14641466
OR has_table_privilege(c.oid,'SELECT')
14651467
OR has_table_privilege(c.oid,'UPDATE') );
@@ -1690,6 +1692,7 @@ CREATE VIEW table_constraints AS
16901692
WHEREnc.oid=c.connamespaceANDnr.oid=r.relnamespace
16911693
ANDc.conrelid=r.oid
16921694
ANDr.relkind='r'
1695+
AND (nr.nspname NOTLIKE'pg!_temp!_%' ESCAPE'!'ORpg_catalog.pg_table_is_visible(r.oid))
16931696
AND (pg_has_role(r.relowner,'USAGE')
16941697
-- SELECT privilege omitted, per SQL standard
16951698
OR has_table_privilege(r.oid,'INSERT')
@@ -1723,6 +1726,7 @@ CREATE VIEW table_constraints AS
17231726
ANDa.attnum>0
17241727
AND NOTa.attisdropped
17251728
ANDr.relkind='r'
1729+
AND (nr.nspname NOTLIKE'pg!_temp!_%' ESCAPE'!'ORpg_catalog.pg_table_is_visible(r.oid))
17261730
AND (pg_has_role(r.relowner,'USAGE')
17271731
OR has_table_privilege(r.oid,'SELECT')
17281732
OR has_table_privilege(r.oid,'INSERT')
@@ -1824,6 +1828,7 @@ CREATE VIEW tables AS
18241828

18251829
WHEREc.relnamespace=nc.oid
18261830
ANDc.relkindIN ('r','v')
1831+
AND (nc.nspname NOTLIKE'pg!_temp!_%' ESCAPE'!'ORpg_catalog.pg_table_is_visible(c.oid))
18271832
AND (pg_has_role(c.relowner,'USAGE')
18281833
OR has_table_privilege(c.oid,'SELECT')
18291834
OR has_table_privilege(c.oid,'INSERT')
@@ -1945,6 +1950,7 @@ CREATE VIEW triggers AS
19451950
ANDc.oid=t.tgrelid
19461951
ANDt.tgtype &em.num<>0
19471952
AND NOTt.tgisconstraint
1953+
AND (n.nspname NOTLIKE'pg!_temp!_%' ESCAPE'!'ORpg_catalog.pg_table_is_visible(c.oid))
19481954
AND (pg_has_role(c.relowner,'USAGE')
19491955
-- SELECT privilege omitted, per SQL standard
19501956
OR has_table_privilege(c.oid,'INSERT')
@@ -2143,6 +2149,7 @@ CREATE VIEW views AS
21432149

21442150
WHEREc.relnamespace=nc.oid
21452151
ANDc.relkind='v'
2152+
AND (nc.nspname NOTLIKE'pg!_temp!_%' ESCAPE'!'ORpg_catalog.pg_table_is_visible(c.oid))
21462153
AND (pg_has_role(c.relowner,'USAGE')
21472154
OR has_table_privilege(c.oid,'SELECT')
21482155
OR has_table_privilege(c.oid,'INSERT')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp