Re: current database? - Mailing list pgsql-general

From Tom Lane
Subject Re: current database?
Date
Msg-id 15697.961438579@sss.pgh.pa.us
Whole thread Raw
In response to current database?  (mikeo <mikeo@spectrumtelecorp.com>)
List 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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_sorttemp*
Next
From: "Stephan Szabo"
Date:
Subject: Re: A Query on PG_ tables