Re: current database?

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: mikeo <mikeo@spectrumtelecorp.com>
Cc: pgsql-general@postgresql.org
Date: 2000-06-19T18:16:19Z
Lists: pgsql-general
mikeo <mikeo@spectrumtelecorp.com> writes:
>  when i do \c - postgres tells me which
> database i'm currently connected to.  where
> does it get this info?  i'd like to use it
> in a program.  

If you're working directly with libpq, then PQdb() et al return
the connection parameters used to create the current PGconn object.

			regards, tom lane