Re: Retrieving database schema

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>
Cc: Gary M <postgres-general(at)mwwm(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: Retrieving database schema
Date: 2003-03-23 04:39:41
Message-ID: 26200.1048394381@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Lamar Owen <lamar(dot)owen(at)wgcr(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gary M 2003-03-23 04:43:32 Re: Retrieving database schema
Previous Message Lamar Owen 2003-03-23 03:57:52 Re: Retrieving database schema