|
4 | 4 | *
|
5 | 5 | * Copyright (c) 2003-2006, PostgreSQL Global Development Group
|
6 | 6 | *
|
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 $ |
8 | 8 | */
|
9 | 9 |
|
10 | 10 | /*
|
@@ -644,7 +644,7 @@ CREATE VIEW columns AS
|
644 | 644 | WHERE a.attrelid = c.oid
|
645 | 645 | AND a.atttypid = t.oid
|
646 | 646 | AND nc.oid = c.relnamespace
|
647 |
| - |
| 647 | + AND (nc.nspname NOT LIKE 'pg!_temp!_%' ESCAPE '!' OR pg_catalog.pg_table_is_visible(c.oid)) |
648 | 648 | AND a.attnum > 0 AND NOT a.attisdropped AND c.relkind in ('r', 'v')
|
649 | 649 |
|
650 | 650 | AND (pg_has_role(c.relowner, 'USAGE')
|
@@ -933,6 +933,7 @@ CREATE VIEW key_column_usage AS
|
933 | 933 | AND nc.oid = c.connamespace
|
934 | 934 | AND c.contype IN ('p', 'u', 'f')
|
935 | 935 | AND r.relkind = 'r'
|
| 936 | + AND (nr.nspname NOT LIKE 'pg!_temp!_%' ESCAPE '!' OR pg_catalog.pg_table_is_visible(r.oid)) |
936 | 937 | AND (pg_has_role(r.relowner, 'USAGE')
|
937 | 938 | OR has_table_privilege(c.oid, 'SELECT')
|
938 | 939 | OR has_table_privilege(c.oid, 'INSERT')
|
@@ -1459,7 +1460,8 @@ CREATE VIEW sequences AS
|
1459 | 1460 | CAST(null AS character_data) AS cycle_option -- FIXME
|
1460 | 1461 | FROM pg_namespace nc, pg_class c
|
1461 | 1462 | WHERE c.relnamespace = nc.oid
|
1462 |
| - AND c.relkind = 's' |
| 1463 | + AND c.relkind = 'S' |
| 1464 | + AND (nc.nspname NOT LIKE 'pg!_temp!_%' ESCAPE '!' OR pg_catalog.pg_table_is_visible(c.oid)) |
1463 | 1465 | AND (pg_has_role(c.relowner, 'USAGE')
|
1464 | 1466 | OR has_table_privilege(c.oid, 'SELECT')
|
1465 | 1467 | OR has_table_privilege(c.oid, 'UPDATE') );
|
@@ -1690,6 +1692,7 @@ CREATE VIEW table_constraints AS
|
1690 | 1692 | WHERE nc.oid = c.connamespace AND nr.oid = r.relnamespace
|
1691 | 1693 | AND c.conrelid = r.oid
|
1692 | 1694 | AND r.relkind = 'r'
|
| 1695 | + AND (nr.nspname NOT LIKE 'pg!_temp!_%' ESCAPE '!' OR pg_catalog.pg_table_is_visible(r.oid)) |
1693 | 1696 | AND (pg_has_role(r.relowner, 'USAGE')
|
1694 | 1697 | -- SELECT privilege omitted, per SQL standard
|
1695 | 1698 | OR has_table_privilege(r.oid, 'INSERT')
|
@@ -1723,6 +1726,7 @@ CREATE VIEW table_constraints AS
|
1723 | 1726 | AND a.attnum > 0
|
1724 | 1727 | AND NOT a.attisdropped
|
1725 | 1728 | AND r.relkind = 'r'
|
| 1729 | + AND (nr.nspname NOT LIKE 'pg!_temp!_%' ESCAPE '!' OR pg_catalog.pg_table_is_visible(r.oid)) |
1726 | 1730 | AND (pg_has_role(r.relowner, 'USAGE')
|
1727 | 1731 | OR has_table_privilege(r.oid, 'SELECT')
|
1728 | 1732 | OR has_table_privilege(r.oid, 'INSERT')
|
@@ -1824,6 +1828,7 @@ CREATE VIEW tables AS
|
1824 | 1828 |
|
1825 | 1829 | WHERE c.relnamespace = nc.oid
|
1826 | 1830 | AND c.relkind IN ('r', 'v')
|
| 1831 | + AND (nc.nspname NOT LIKE 'pg!_temp!_%' ESCAPE '!' OR pg_catalog.pg_table_is_visible(c.oid)) |
1827 | 1832 | AND (pg_has_role(c.relowner, 'USAGE')
|
1828 | 1833 | OR has_table_privilege(c.oid, 'SELECT')
|
1829 | 1834 | OR has_table_privilege(c.oid, 'INSERT')
|
@@ -1945,6 +1950,7 @@ CREATE VIEW triggers AS
|
1945 | 1950 | AND c.oid = t.tgrelid
|
1946 | 1951 | AND t.tgtype & em.num <> 0
|
1947 | 1952 | AND NOT t.tgisconstraint
|
| 1953 | + AND (n.nspname NOT LIKE 'pg!_temp!_%' ESCAPE '!' OR pg_catalog.pg_table_is_visible(c.oid)) |
1948 | 1954 | AND (pg_has_role(c.relowner, 'USAGE')
|
1949 | 1955 | -- SELECT privilege omitted, per SQL standard
|
1950 | 1956 | OR has_table_privilege(c.oid, 'INSERT')
|
@@ -2143,6 +2149,7 @@ CREATE VIEW views AS
|
2143 | 2149 |
|
2144 | 2150 | WHERE c.relnamespace = nc.oid
|
2145 | 2151 | AND c.relkind = 'v'
|
| 2152 | + AND (nc.nspname NOT LIKE 'pg!_temp!_%' ESCAPE '!' OR pg_catalog.pg_table_is_visible(c.oid)) |
2146 | 2153 | AND (pg_has_role(c.relowner, 'USAGE')
|
2147 | 2154 | OR has_table_privilege(c.oid, 'SELECT')
|
2148 | 2155 | OR has_table_privilege(c.oid, 'INSERT')
|
|
0 commit comments