Обсуждение: get the list of databases

Поиск
Список
Период
Сортировка

get the list of databases

От
Xavier COUDIN
Дата:
using psql, it is possible to get the list of databases using the
instruction  "\l".

How can I do when I make connection through DBI/DBD ?????


Re: [GENERAL] get the list of databases

От
"Doran L. Barton"
Дата:
Not long ago, Xavier COUDIN proclaimed...
> using psql, it is possible to get the list of databases using the
> instruction  "\l".
>
> How can I do when I make connection through DBI/DBD ?????

Well you need to connect to *some* database (i.e. template1) and then you
can issue the following SQL query:

  SELECT * FROM PG_DATABASE;

Enjoy.

--
Doran L. Barton <fozz@iodynamics.com>
Iodynamics LLC -- "Internetworking the masses"
<URL:http://www.iodynamics.com/>