Re: list of databases in C ? libpq ?
От | Reid Thompson |
---|---|
Тема | Re: list of databases in C ? libpq ? |
Дата | |
Msg-id | 4BEA14A8.6010901@ateb.com обсуждение исходный текст |
Ответ на | Re: list of databases in C ? libpq ? (Alex Hunsaker <badalex@gmail.com>) |
Список | pgsql-general |
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@gmail.com> 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
В списке pgsql-general по дате отправления: