How to determine current database?

Поиск
Список
Период
Сортировка
От Ron St-Pierre
Тема How to determine current database?
Дата
Msg-id 402D582B.1080704@syscor.com
обсуждение исходный текст
Ответы Re: How to determine current database?  (Joe Conway <mail@joeconway.com>)
Re: How to determine current database?  (Eric Ridge <ebr@tcdi.com>)
Re: How to determine current database?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
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:
UPDATE tblUpdates SET xxx=1234 WHERE pg_current = TRUE;
or
UPDATE tblUpdates SET xxx=1234 WHERE pg_current = thisDBname;

We have about 15 databases all set up identically and when the structure
changes I run scripts to update them to ensure that they are all the
same. I need to create two new databases which have slight changes
(different default values - for now) and want to be able to have my
scripts be able to determine which database their running from.

Thanks

Ron


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

Предыдущее
От: Ron St-Pierre
Дата:
Сообщение: Re: resource monitoring
Следующее
От: Joe Conway
Дата:
Сообщение: Re: How to determine current database?