More to come, but these two are probably worth backpatching. Sequences
were not being shown due to the use of lowercase 's' instead of 'S', and
the views were not checking for table visibility with regards to
temporary tables and sequences.

--
Greg Sabino Mullane [EMAIL PROTECTED]
End Point Corporation
PGP Key: 0x14964AC8 200608181942
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

Index: information_schema.sql
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/catalog/information_schema.sql,v
retrieving revision 1.33
diff -u -c -r1.33 information_schema.sql
*** information_schema.sql	2 Apr 2006 17:38:13 -0000	1.33
--- information_schema.sql	18 Aug 2006 23:26:22 -0000
***************
*** 644,650 ****
      WHERE a.attrelid = c.oid
            AND a.atttypid = t.oid
            AND nc.oid = c.relnamespace
! 
            AND a.attnum > 0 AND NOT a.attisdropped AND c.relkind in ('r', 'v')
  
            AND (pg_has_role(c.relowner, 'USAGE')
--- 644,650 ----
      WHERE a.attrelid = c.oid
            AND a.atttypid = t.oid
            AND nc.oid = c.relnamespace
!           AND (nc.nspname NOT LIKE 'pg!_temp!_%' ESCAPE '!' OR pg_catalog.pg_table_is_visible(c.oid))
            AND a.attnum > 0 AND NOT a.attisdropped AND c.relkind in ('r', 'v')
  
            AND (pg_has_role(c.relowner, 'USAGE')
***************
*** 933,938 ****
--- 933,939 ----
                  AND nc.oid = c.connamespace
                  AND c.contype IN ('p', 'u', 'f')
                  AND r.relkind = 'r'
+                 AND (nr.nspname NOT LIKE 'pg!_temp!_%' ESCAPE '!' OR pg_catalog.pg_table_is_visible(r.oid))
                  AND (pg_has_role(r.relowner, 'USAGE')
                       OR has_table_privilege(c.oid, 'SELECT')
                       OR has_table_privilege(c.oid, 'INSERT')
***************
*** 1459,1465 ****
             CAST(null AS character_data) AS cycle_option    -- FIXME
      FROM pg_namespace nc, pg_class c
      WHERE c.relnamespace = nc.oid
!           AND c.relkind = 's'
            AND (pg_has_role(c.relowner, 'USAGE')
                 OR has_table_privilege(c.oid, 'SELECT')
                 OR has_table_privilege(c.oid, 'UPDATE') );
--- 1460,1467 ----
             CAST(null AS character_data) AS cycle_option    -- FIXME
      FROM pg_namespace nc, pg_class c
      WHERE c.relnamespace = nc.oid
!           AND c.relkind = 'S'
!           AND (nc.nspname NOT LIKE 'pg!_temp!_%' ESCAPE '!' OR pg_catalog.pg_table_is_visible(c.oid))
            AND (pg_has_role(c.relowner, 'USAGE')
                 OR has_table_privilege(c.oid, 'SELECT')
                 OR has_table_privilege(c.oid, 'UPDATE') );
***************
*** 1690,1695 ****
--- 1692,1698 ----
      WHERE nc.oid = c.connamespace AND nr.oid = r.relnamespace
            AND c.conrelid = r.oid
            AND r.relkind = 'r'
+           AND (nr.nspname NOT LIKE 'pg!_temp!_%' ESCAPE '!' OR pg_catalog.pg_table_is_visible(r.oid))
            AND (pg_has_role(r.relowner, 'USAGE')
                 -- SELECT privilege omitted, per SQL standard
                 OR has_table_privilege(r.oid, 'INSERT')
***************
*** 1723,1728 ****
--- 1726,1732 ----
            AND a.attnum > 0
            AND NOT a.attisdropped
            AND r.relkind = 'r'
+           AND (nr.nspname NOT LIKE 'pg!_temp!_%' ESCAPE '!' OR pg_catalog.pg_table_is_visible(r.oid))
            AND (pg_has_role(r.relowner, 'USAGE')
                 OR has_table_privilege(r.oid, 'SELECT')
                 OR has_table_privilege(r.oid, 'INSERT')
***************
*** 1824,1829 ****
--- 1828,1834 ----
  
      WHERE c.relnamespace = nc.oid
            AND c.relkind IN ('r', 'v')
+           AND (nc.nspname NOT LIKE 'pg!_temp!_%' ESCAPE '!' OR pg_catalog.pg_table_is_visible(c.oid))
            AND (pg_has_role(c.relowner, 'USAGE')
                 OR has_table_privilege(c.oid, 'SELECT')
                 OR has_table_privilege(c.oid, 'INSERT')
***************
*** 1945,1950 ****
--- 1950,1956 ----
            AND c.oid = t.tgrelid
            AND t.tgtype & em.num <> 0
            AND NOT t.tgisconstraint
+           AND (n.nspname NOT LIKE 'pg!_temp!_%' ESCAPE '!' OR pg_catalog.pg_table_is_visible(c.oid))
            AND (pg_has_role(c.relowner, 'USAGE')
                 -- SELECT privilege omitted, per SQL standard
                 OR has_table_privilege(c.oid, 'INSERT')
***************
*** 2143,2148 ****
--- 2149,2155 ----
  
      WHERE c.relnamespace = nc.oid
            AND c.relkind = 'v'
+           AND (nc.nspname NOT LIKE 'pg!_temp!_%' ESCAPE '!' OR pg_catalog.pg_table_is_visible(c.oid))
            AND (pg_has_role(c.relowner, 'USAGE')
                 OR has_table_privilege(c.oid, 'SELECT')
                 OR has_table_privilege(c.oid, 'INSERT')

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to