Re: How do I make a query return all table names?

From: "Robert Treat" <robertt(at)auctionsolutions(dot)com>
To: "Konrad" <konradatwork(at)hotmail(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: How do I make a query return all table names?
Date: 2002-02-25 15:12:07
Message-ID: AMENJOLMNKAEOIGHHILBMEBLCIAA.robertt@auctionsolutions.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

off the top of my head:
"select tablename from pg_tables" will give you all tables.

"select tablename from pg_tables where tablename not like 'pg_%'" would
eliminate the internal postgres tables (and any of your's if they're name
starts with pg_)

there are fancier ways to do it, but that should work.

Robert

> -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org
> [mailto:pgsql-general-owner(at)postgresql(dot)org]On Behalf Of Konrad
> Sent: Saturday, February 23, 2002 10:38 PM
> To: pgsql-general(at)postgresql(dot)org
> Subject: [GENERAL] How do I make a query return all table names?
>
>
> I just want to send a query to the db that returns a list of all names
> of all of the tables in the current database.
>
> Is there such a query?
>
> Thanks,
>
> Konrad
> konradatwork(at)hotmail(dot)com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2002-02-25 15:20:39 Re: Work Around For Oracle Feature
Previous Message Doug McNaught 2002-02-25 15:10:15 Re: help with getting index scan