Re: List of tables with a query

Поиск
Список
Период
Сортировка
От Anthony E. Greene
Тема Re: List of tables with a query
Дата
Msg-id 3.0.5.32.20000606113642.007ed100@fmol.5sigcmd.army.mil
обсуждение исходный текст
Ответ на List of tables with a query  (NRonayette <r97m10@socotec.fr>)
Список pgsql-novice
At 09:44 2000-06-06 +0100, NRonayette wrote:
>I'm looking for the tables or views witch containt the list of my
>database 's objects.

This will get you a list of databases:

 SELECT datname FROM pg_database

Then for each database name returned, connect to the database and run:

 SELECT relname FROM pg_class WHERE relname NOT LIKE 'pg_%' AND relkind='r'


I use perl and put the results of the first query into an array. I step
through the array, connect to each database, and get the list of tables
using the second query.

 Tony
 --
 Anthony E. Greene <agreene@pobox.com>
 PGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26  C484 A42A 60DD 6C94 239D
 Linux: The choice of a GNU Generation.

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

Предыдущее
От: Christopher Sawtell
Дата:
Сообщение: Re: [SQL] moving DB
Следующее
От: patrick.wolf@Aerojet.com (WOLF, PATRICK)
Дата:
Сообщение: RE: moving DB