Re: parsing relname in pg_class

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: parsing relname in pg_class
Date: 2002-04-01 23:02:10
Message-ID: 16602.1017702130@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com> writes:
> I'm writing a perl script where I only want to parse
> out a list of tables from the database I'm connecting
> to.

> select relname from pg_class
> where relname not like '%_i%';

That doesn't seem very helpful; what's worse is it might hide tables you
want. Something like

select relname from pg_class
where relname not like 'pg\\_%' and relkind = 'r';

would probably be a lot closer to what you want.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marin Dimitrov 2002-04-01 23:25:14 tables > 2GB
Previous Message Neil Conway 2002-04-01 22:28:41 Re: parsing relname in pg_class