Re: How to determine current database?

Поиск
Список
Период
Сортировка
От Ron St-Pierre
Тема Re: How to determine current database?
Дата
Msg-id 402D702C.5010605@syscor.com
обсуждение исходный текст
Ответ на Re: How to determine current database?  (Eric Ridge <ebr@tcdi.com>)
Список pgsql-general
Eric Ridge wrote:

> On Feb 13, 2004, at 6:05 PM, Ron St-Pierre wrote:
>
>> I am using postgres 7.3.4 and need to be able to determine which
>> database a query is being run in (from a script). pg_database lists
>> databases but doesn't tell me which one is currently active. Is there
>> a query I can use along the lines of:
>
>
> The built-in function "current_database()" returns the current
> database name.
>
> =# select current_database();
>  current_database
> ------------------
>  testing
> (1 row)
>
> Use it in your update statements too.
>
> eric

That's exactly what I need!

Joe Conway wrote:

> See:
> http://www.postgresql.org/docs/7.3/static/functions-misc.html


Thanks guys. I was searching the docs looking for functions starting
with pg_

Ron


В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: How to determine current database?
Следующее
От: Mark Kirkwood
Дата:
Сообщение: Re: Quad Xeon vs. Dual Itanium