Re: [GENERAL] How to find names of tables in a database? - Mailing list pgsql-general

From Simon Drabble
Subject Re: [GENERAL] How to find names of tables in a database?
Date
Msg-id Pine.LNX.3.95.981014192059.29439A-100000@fiddletrudge.dyn.ml.org
Whole thread Raw
In response to How to find names of tables in a database?  (Valerie Mates <popcorn@tir.com>)
List pgsql-general
On Wed, 14 Oct 1998, Valerie Mates wrote:

> Hi -- I've been dabbling in PostgreSQL on and off for a few months now.  At
> this point I can get it to do a number of neat things, but I've run into
> one that is a stumper.
>
> I'm looking for a way that my Perl program can look up the names of the
> tables in a database.  Is there a way to do this?  I've looked through the
> documentation on the PostgreSQL website, but didn't find any way to do
> this.  It seems like there must be a query like "SELECT table_names FROM
> my_database" to do this, but if there is, I haven't found it yet.

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

will give you all user-defined tables.


Simon.


>
> (My apologies if this has been discussed recently.  I was on this mailing
> list for a while, but have been off it for a month or so.)
>
> Thanks for any help you can offer!
>
> -Valerie Mates
>
>     -------------------------------------------------------------------
>       Valerie Mates  *  Web Developer  *  http://www.valeriemates.com
>                valerie@cyberspace.org  *  (734) 995-6716
>     -------------------------------------------------------------------
>
>
>

--
  There are three kinds of people in this world: Those who can count,
     and those who can't.

   Simon Drabble                     mailto:madlather@syspac.com
   http://fiddletrudge.dyn.ml.org/
   KreatAPayj           --        KAP2/login.html
   LizardCam            --        LizardCam/LizCam.html


pgsql-general by date:

Previous
From: "Gene Selkov Jr."
Date:
Subject: Re: [GENERAL] How to find names of tables in a database?
Next
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] How to find names of tables in a database?