| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера