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

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

From
"Frankie"
Date:
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




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

From
Tilo Schwarz
Date:
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