Re: current database?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: mikeo <mikeo(at)spectrumtelecorp(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: current database?
Date: 2000-06-19 18:16:19
Message-ID: 15697.961438579@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

mikeo <mikeo(at)spectrumtelecorp(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2000-06-19 18:48:54 Re: A Query on PG_ tables
Previous Message Tom Lane 2000-06-19 18:09:59 Re: pg_sorttemp*