From: | Alfred Perlstein <bright(at)wintelcom(dot)net> |
---|---|
To: | Limin Liu <limin(at)pumpkinnet(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: database name. |
Date: | 2000-11-08 03:26:42 |
Message-ID: | 20001107192642.O5112@fw.wintelcom.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
* Limin Liu <limin(at)pumpkinnet(dot)com> [001107 19:11] wrote:
> Hi,
>
> I am new in PostgreSQL and have a simple question:
> Is there any way we can find out which db the current client is working
> with?
>
> In psql, the prompt tells us the current open db, but I may need to
> access that information in a C client on the fly with may db opened. I
> wonder if this is possible?
Yes, please check the docs:
PQdb Returns the database name of the connection.
char *PQdb(const PGconn *conn)
PQdb and the next several functions return the values established at connection. These values are fixed for the life
of the PGconn object.
It's described in the 'libpq' section of the programmer's manual.
--
-Alfred Perlstein - [bright(at)wintelcom(dot)net|alfred(at)freebsd(dot)org]
"I have the heart of a child; I keep it in a jar on my desk."
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2000-11-08 05:36:15 | Re: PGBUFFERS |
Previous Message | Yann Ramin | 2000-11-08 03:06:37 | Re: filemaker to pgsql ? |