Re: postgres 7.0.2
От | Dominic J. Eidson |
---|---|
Тема | Re: postgres 7.0.2 |
Дата | |
Msg-id | Pine.LNX.4.10.10008221201580.25131-100000@morannon.the-infinite.org обсуждение исходный текст |
Ответ на | Re: postgres 7.0.2 (Thomas Swan <tswan-lst@tangent.ics.olemiss.edu>) |
Список | pgsql-hackers |
On Tue, 22 Aug 2000, Thomas Swan wrote: > Actually, I think I understand the question. The original person wants to > be able to do a query and get a result containing a list of > databases. AFAIK, there isn't a way to do this using standard SQL-like > statements. Somebody correct me if I'm wrong. SELECT pg_database.datname as "Database", pg_user.usename as "Owner" FROM pg_database, pg_user WHERE pg_database.datdba= pg_user.usesysid UNION SELECT pg_database.datname as "Database", NULL as "Owner" FROM pg_database WHERE pg_database.datdba NOT IN (SELECT usesysidFROM pg_user) ORDER BY "Database"; (Which is what psql sends to the backend in response to the "\l" command.) -- Dominic J. Eidson "Baruk Khazad! Khazad ai-menu!" - Gimli ------------------------------------------------------------------------------- http://www.the-infinite.org/ http://www.the-infinite.org/~dominic/
В списке pgsql-hackers по дате отправления: