Re: Get the tables names?

Поиск
Список
Период
Сортировка
От Dado Feigenblatt
Тема Re: Get the tables names?
Дата
Msg-id 3B588D48.80803@wildbrain.com
обсуждение исходный текст
Ответ на Get the tables names?  ("Magnus Landahl" <magnus.landahl@datessa.se>)
Ответы Re: Get the tables names?  (Joel Burton <jburton@scw.org>)
Re: Get the tables names?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
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.






В списке pgsql-sql по дате отправления:

Предыдущее
От: Dado Feigenblatt
Дата:
Сообщение: PLpgSQL
Следующее
От: "Josh Berkus"
Дата:
Сообщение: Re: nextval on insert by arbitrary sequence