Re: Displaying database names from within application

From: "Travis Hoyt" <thoyt(at)npc(dot)net>
To: "William C Brennan" <brennan(at)netaxs(dot)com>, <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Displaying database names from within application
Date: 2002-02-15 14:19:15
Message-ID: DBEMKMGOMJAGKAKEPPEGAEMHCPAA.thoyt@npc.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

select datname from pg_database;

-----Original Message-----
From: pgsql-novice-owner(at)postgresql(dot)org
[mailto:pgsql-novice-owner(at)postgresql(dot)org]On Behalf Of William C Brennan
Sent: Friday, February 15, 2002 8:58 AM
To: pgsql-novice(at)postgresql(dot)org
Subject: [NOVICE] Displaying database names from within application

I'm writing an application program which uses Postgresql
functionality via calls to the library libpq.

One of the things I'd like to do is present the user with a list of
possible database names to choose from, nicely formatted from within
a GUI, but I can't seem to find a way to access the database names
through system calls.

(Of course, I could make a system call, asking Unix to interpret the
string "psql -l", but I'd like to thing there is a more direct route
available to me, performing the same call to the Postgresql backend
that the command "psql -l" must do itself.)

I see in the Developer's Guide that there are catalogs with this
information, but I don't know how to query the catalogs.

Can someone help?

Thanks!

-- Bill

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2002-02-15 15:14:01 Re: problem in executing a function
Previous Message William C Brennan 2002-02-15 13:58:10 Displaying database names from within application