| От | Michael Fuhr |
|---|---|
| Тема | Re: How to list databases with SQL statement? |
| Дата | |
| Msg-id | 20041123045640.GA22766@winnie.fuhr.org обсуждение исходный текст |
| Ответ на | How to list databases with SQL statement? (Marian D Marinov <hackman@hydra.azilian.net>) |
| Список | pgsql-general |
On Sat, Nov 20, 2004 at 12:39:38AM +0000, Marian D Marinov wrote: > Is there a way to list all databases which belong to the current user with an > SQL query? Such information is in the system catalogs: http://www.postgresql.org/docs/7.4/static/catalogs.html If you run psql with the -E option, you can see the queries that psql makes when you issue commands like \l to show the list of databases and their owners. You can then copy those queries and modify them to meet your needs. The name of the current user is available as CURRENT_USER and SESSION_USER -- see the Miscellaneous Functions documentation for the difference: http://www.postgresql.org/docs/7.4/static/functions-misc.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера