Search Postgresql Archives

Re: list of databases in C ? libpq ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/7/2010 1:48 PM, Alex Hunsaker wrote:
On Fri, May 7, 2010 at 11:18, Joao Ferreira gmail
<joao.miguel.c.ferreira@xxxxxxxxx>  wrote:
Hello all,

I need to write an application in C to read the list of databases
currently in the server. very much like a "psql -l"...

The first example in the online docs does exactly that...
http://www.postgresql.org/docs/8.1/static/libpq-example.html

$ cc -I /usr/include/postgresql-8.4/ -lpq libpq.c -o libpqex

$ ./libpqex dbname=test
datname datdba encoding datcollate datctype datistemplate datallowconn datconnlimit datlastsysoid datfrozenxid dattablespace datconfig datacl

template1 10 6 en_US.UTF-8 en_US.UTF-8 t t -1 11563 648 1663 {=c/postgres,postgres=CTc/postgres} template0 10 6 en_US.UTF-8 en_US.UTF-8 t f -1 11563 648 1663 {=c/postgres,postgres=CTc/postgres} postgres 10 6 en_US.UTF-8 en_US.UTF-8 f t -1 11563 648 1663 test 16384 6 en_US.UTF-8 en_US.UTF-8 f t -1 11563 648 1663 sigcap 16438 0 en_US.UTF-8 en_US.UTF-8 f t -1 11563 648 1663


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux