From: Dado Feigenblatt <dado@wildbrain.com>
To: Magnus Landahl <magnus.landahl@datessa.se>
To: pgsql <pgsql-sql@postgresql.org>
Subject: Re: Get the tables names?
Date: Fri, 20 Jul 2001 12:58:00 -0700
Message-ID: <3B588D48.80803@wildbrain.com> (raw)
References: <9j67ra$m1$1@news.tht.net>
Magnus Landahl wrote:
>Hi everybody!
>
>Is it possible to get the names of all tables in the database with a sql
>query??
>
>Best regards,
>
>Magnus
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: if posting/reading through Usenet, please send an appropriate
>subscribe-nomail command to majordomo@postgresql.org so that your
>message can get through to the mailing list cleanly
>
>
>
Not sure if this is the best way, but it works.
SELECT relname , relowner from pg_class where relkind = 'r';
The only thing is that this includes system tables.
So if you want to strip those you need to
SELECT relname , relowner FROM pg_class WHERE relkind = 'r' and
relowner != 26;
Is user postgres always 26? Maybe you have to find that out first.
--
Dado Feigenblatt Wild Brain, Inc.
Technical Director (415) 553-8000 x???
dado@wildbrain.com San Francisco, CA.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dado@wildbrain.com, magnus.landahl@datessa.se
Subject: Re: Get the tables names?
In-Reply-To: <3B588D48.80803@wildbrain.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox