Re: list of databases in C ? libpq ? - Mailing list pgsql-general

From Alex Hunsaker
Subject Re: list of databases in C ? libpq ?
Date
Msg-id z2u34d269d41005071048l22482478z8ccd72b42486edd7@mail.gmail.com
Whole thread Raw
In response to list of databases in C ? libpq ?  (Joao Ferreira gmail <joao.miguel.c.ferreira@gmail.com>)
Responses Re: list of databases in C ? libpq ?  (Reid Thompson <reid.thompson@ateb.com>)
List pgsql-general
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"...

select datname as database from pg_database;

> but I need it in C ! I never used C before to access PG.
>
> the libpq API seems a bit scary ! Is there anything, shipped with
> postgresql, other than libpq that would make my life simpler ?

Maybe ecpg http://www.postgresql.org/docs/current/static/ecpg.html ? I
also hear good things about libpqtypes making some things easier
http://pgfoundry.org/projects/libpqtypes/.

pgsql-general by date:

Previous
From: Steve Clark
Date:
Subject: Re: postgreSQL not working after upgrade to Ubuntu 10.4
Next
From: AllieH
Date:
Subject: Re: postgreSQL not working after upgrade to Ubuntu 10.4