Re: really novice with Postgres !

Поиск
Список
Период
Сортировка
От raghu ram
Тема Re: really novice with Postgres !
Дата
Msg-id CALnrrJROC5xpXvGEnP+0C7V9UDfXVE5xAstf2iQVzUVip4kSGQ@mail.gmail.com
обсуждение исходный текст
Ответ на really novice with Postgres !  (Jean MAURICE <mauricejea@numericable.fr>)
Список pgsql-novice

On Fri, Aug 2, 2013 at 6:21 PM, Jean MAURICE <mauricejea@numericable.fr> wrote:
Hi everybody,

I have some more questions :
Is there a SQL command to
 - test if a database exists
postgres=# select * from pg_database where datname='<DB name>';

  or
postgres=# \l
 
 - test if a table exists

postgres=# select * from pg_class where rename='<tablename>';
 
 
 - get the list of the tables of a database

 postgres=# \dt

       or
postgres=# select * from pg_class

 - get the structure (list of fields) of a table

 
 postgres=# \d <tablename>

Thanks & Regards
Raghu Ram

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

Предыдущее
От: Tovo Rabemanantsoa
Дата:
Сообщение: Re: really novice with Postgres !
Следующее
От: Jean MAURICE
Дата:
Сообщение: Re: really novice with Postgres !