Thread: get the list of databases

get the list of databases

From
Xavier COUDIN
Date:
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

From
"Doran L. Barton"
Date:
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/>