From: Larry Rosenman <ler@lerctr.org>
To: Ben Siders <bsiders@cms-stl.com>
To: pgsql-sql@postgresql.org
Subject: Re: SQL to list databases?
Date: Thu, 23 Jan 2003 14:30:31 -0600
Message-ID: <60030000.1043353831@lerlaptop.iadfw.net> (raw)
In-Reply-To: <3E303AF2.10603@cms-stl.com>
References: <81132473206F3A46A72BD6116E1A06AE1B14CC@black.aprote.com>
<26610.1043341252@sss.pgh.pa.us>
<3E303AF2.10603@cms-stl.com>
--On Thursday, January 23, 2003 12:56:50 -0600 Ben Siders
<bsiders@cms-stl.com> wrote:
>
> Is there a query that will return all the databases available, similar to
> what psql -l does?
>
$ psql -E -l
********* QUERY **********
SELECT d.datname as "Name",
u.usename as "Owner",
pg_catalog.pg_encoding_to_char(d.encoding) as "Encoding"
FROM pg_catalog.pg_database d
LEFT JOIN pg_catalog.pg_user u ON d.datdba = u.usesysid
ORDER BY 1;
**************************
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>
--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: ler@lerctr.org, bsiders@cms-stl.com
Subject: Re: SQL to list databases?
In-Reply-To: <60030000.1043353831@lerlaptop.iadfw.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox