Thread: pg_tables view definition incorrect??

pg_tables view definition incorrect??

From
"Mike Quinn"
Date:
version=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
---------------------------------------------------------------
 PostgreSQL 7.3.2 on i586-pc-linux-gnu, compiled by GCC 2.95.3
(1 row)

    View "pg_catalog.pg_tables"
   Column    |  Type   | Modifiers=20
-------------+---------+-----------
 schemaname  | name    |=20
 tablename   | name    |=20
 tableowner  | name    |=20
 hasindexes  | boolean |=20
 hasrules    | boolean |=20
 hastriggers | boolean |=20
View definition: SELECT n.nspname AS schemaname, c.relname AS tablename, pg=
_get_userbyid(c.relowner) AS tableowner, c.relhasindex AS hasindexes, c.rel=
hasrules AS hasrules, (c.reltriggers > 0) AS hastriggers FROM (pg_class c L=
EFT JOIN pg_namespace n ON ((n.oid =3D c.relnamespace))) WHERE ((c.relkind =
=3D 'r'::"char") OR (c.relkind =3D 's'::"char"));

Given that 'S' =3D> Sequence and 's' =3D> special shouldn't the last condit=
ion in the WHERE clause be:

c.relkind =3D 'S'::"char"

instead of

c.relkind =3D 's'::"char"

Re: pg_tables view definition incorrect??

From
Tom Lane
Date:
"Mike Quinn" <mquinn@co.merced.ca.us> writes:
> Given that 'S' => Sequence and 's' => special shouldn't the last condition in the WHERE clause be:
> c.relkind = 'S'::"char"

Only if you suppose that pg_tables should show sequences, which was not
the intention.  (I'm not real sure why 's' relations are listed, since
they're not really tables either, but the view is operating as
designed.)

I'm prepared to listen to an argument that pg_tables should show
sequences, but that's a definition change not a bug fix.  Want to
bring it up on -general or -hackers?

            regards, tom lane