Re: SQL query: List all the databases in the server

Поиск
Список
Период
Сортировка
От Vince Vielhaber
Тема Re: SQL query: List all the databases in the server
Дата
Msg-id Pine.BSF.4.30.0107030740100.56876-100000@paprika.michvhf.com
обсуждение исходный текст
Ответ на SQL query: List all the databases in the server  (Roman Smirnov <smirnov@dresearch.de>)
Ответы Re: SQL query: List all the databases in the server  (Tom Ivar Helbekkmo <tih@kpnQwest.no>)
Список pgsql-docs
On Tue, 3 Jul 2001, Roman Smirnov wrote:

> Hi all!
>
> I need SQL analog of \l command from psql.
> Something like "list databases".

If you just want a list of them you can get it from pg_database:

select datname from pg_database;

if you also want the username of the database owner you'll have to
cross pg_database.datdba to pg_user.usesysid something like this:

select d.datname,u.usename from pg_database d, pg_user u where d.datdba = u.usesysid;

Vince.
--
==========================================================================
Vince Vielhaber -- KA8CSH    email: vev@michvhf.com    http://www.pop4.net
         56K Nationwide Dialup from $16.00/mo at Pop4 Networking
        Online Campground Directory    http://www.camping-usa.com
       Online Giftshop Superstore    http://www.cloudninegifts.com
==========================================================================




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

Предыдущее
От: Roman Smirnov
Дата:
Сообщение: SQL query: List all the databases in the server
Следующее
От: Justin Clift
Дата:
Сообщение: Re: replication