Re: [BUGS] pg_tables view definition incorrect?? - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: [BUGS] pg_tables view definition incorrect??
Date
Msg-id 200307211520.h6LFK5b11934@candle.pha.pa.us
Whole thread Raw
List pgsql-patches
You are correct.  Patch attached and applied.

---------------------------------------------------------------------------

Mike Quinn wrote:
>                             version
> ---------------------------------------------------------------
>  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
> -------------+---------+-----------
>  schemaname  | name    |
>  tablename   | name    |
>  tableowner  | name    |
>  hasindexes  | boolean |
>  hasrules    | boolean |
>  hastriggers | boolean |
> View definition: SELECT n.nspname AS schemaname, c.relname AS tablename, pg_get_userbyid(c.relowner) AS tableowner,
c.relhasindexAS hasindexes, c.relhasrules AS hasrules, (c.reltriggers > 0) AS hastriggers FROM (pg_class c LEFT JOIN
pg_namespacen ON ((n.oid = c.relnamespace))) WHERE ((c.relkind = 'r'::"char") OR (c.relkind = 's'::"char")); 
>
> Given that 'S' => Sequence and 's' => special shouldn't the last condition in the WHERE clause be:
>
> c.relkind = 'S'::"char"
>
> instead of
>
> c.relkind = 's'::"char"
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/bin/initdb/initdb.sh
===================================================================
RCS file: /cvsroot/pgsql-server/src/bin/initdb/initdb.sh,v
retrieving revision 1.195
diff -c -c -r1.195 initdb.sh
*** src/bin/initdb/initdb.sh    15 Jul 2003 00:11:14 -0000    1.195
--- src/bin/initdb/initdb.sh    21 Jul 2003 15:17:38 -0000
***************
*** 786,792 ****
          C.relhasrules AS hasrules, \
          (C.reltriggers > 0) AS hastriggers \
      FROM pg_class C LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) \
!     WHERE C.relkind IN ('r', 's');

  CREATE VIEW pg_indexes AS \
      SELECT \
--- 786,792 ----
          C.relhasrules AS hasrules, \
          (C.reltriggers > 0) AS hastriggers \
      FROM pg_class C LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) \
!     WHERE C.relkind IN ('r', 'S');

  CREATE VIEW pg_indexes AS \
      SELECT \

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Eliminate information_schema from oid2name listing
Next
From: Bruce Momjian
Date:
Subject: Re: createlang/droplang fix