Re: database name.

Поиск
Список
Период
Сортировка
От Alfred Perlstein
Тема Re: database name.
Дата
Msg-id 20001107192642.O5112@fw.wintelcom.net
обсуждение исходный текст
Ответ на database name.  (Limin Liu <limin@pumpkinnet.com>)
Список pgsql-general
* Limin Liu <limin@pumpkinnet.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@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."

В списке pgsql-general по дате отправления:

Предыдущее
От: Christian Setzkorn
Дата:
Сообщение: application(s) ???
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PGBUFFERS