Is there a way knowing which database I'm connecting to?

Lists: pgsql-general
From: "Frankie" <frankie(at)ucr(dot)com(dot)hk>
To: pgsql-general(at)postgresql(dot)org
Subject: Is there a way knowing which database I'm connecting to?
Date: 2003-01-23 08:29:34
Message-ID: b0o93e$2crm$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi

Is there a way knowing which database I'm connecting to, e.g. inside an ODBC
connection?
(or if there is any function can get the value of such environment
variable?)

Sorry I don't where to post this question, I guess here is the right place.

Frankie


From: Tilo Schwarz <mail(at)tilo-schwarz(dot)de>
To: "Frankie" <frankie(at)ucr(dot)com(dot)hk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Is there a way knowing which database I'm connecting to?
Date: 2003-01-25 15:57:14
Message-ID: 200301251657.14421.mail@tilo-schwarz.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Frankie writes:
> Hi
>
> Is there a way knowing which database I'm connecting to, e.g. inside an
> ODBC connection?
> (or if there is any function can get the value of such environment
> variable?)
>
> Sorry I don't where to post this question, I guess here is the right place.
>
> Frankie

Maybe this helps:

PostgreSQL 7.3.1 Documentation
6.13. Miscellaneous Functions:

current_database() -> name of current database

Tilo