Re: Retrieving database schema - Mailing list pgsql-general

From Tom Lane
Subject Re: Retrieving database schema
Date
Msg-id 26200.1048394381@sss.pgh.pa.us
Whole thread Raw
In response to Re: Retrieving database schema  (Lamar Owen <lamar.owen@wgcr.org>)
List pgsql-general
Lamar Owen <lamar.owen@wgcr.org> writes:
> I use the following, although it uses pre-7.0 semantics and may or may not
> work with 7.3
> SELECT relname
>               FROM pg_class
>               WHERE relkind = 'r' and relname !~ '^Inv'
>                            and relname !~ '^pg_'
> ORDER BY relname

> I don't remember the reason for the ^Inv regex.

I believe that's a hangover from back when each large object was its own
relation.  [digs in archives...]  OK, that's dead code since 7.1, and it
was wrong before that ... the special relation names were xin* ...

In 7.3, suppressing relnames starting with 'pg_' isn't really quite the
kosher way to hide system tables, either.  It works but it might
suppress legitimate user tables --- there's not a prohibition against
user tables named 'pg_*' anymore.  The best way moving forward will be
to ignore tables that are in system schemas.

            regards, tom lane


pgsql-general by date:

Previous
From: Lamar Owen
Date:
Subject: Re: Retrieving database schema
Next
From: Gary M
Date:
Subject: Re: Retrieving database schema