parsing relname in pg_class

From: "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: parsing relname in pg_class
Date: 2002-04-01 21:29:34
Message-ID: 73309C2FDD95D11192E60008C7B1D5BB0452E17D@snt452.corp.bcbsm.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Howdy:

Running Postgres 7.1.3 on RedHat 7.2 kernel 2.4.7 rel. 10.

I'm writing a perl script where I only want to parse
out a list of tables from the database I'm connecting
to.

I'm doing something like this:

[snip]

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

[/snip]

And that will get me halfway, but I still get a list
of tables with numbers attached and primary keys and the
like (for instance, what is pg_toast?)

Is there an easier way to get a list of the tables ONLY
with a select statement? I don't think I can pass a "\d"
as a variable and get a return and I don't want to make
a case statement for every possibility.

PS: If this comes through as a MIME-type email, let me know -
I'm trying to stop that (using M$ Outlook '97).
Thanks!

-X

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2002-04-01 21:33:07 Blocking object creation for some users
Previous Message David Esposito 2002-04-01 21:22:29 Re: Core dump on PG 7.1.3