Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 054A94778DD for ; Thu, 23 Jan 2003 17:08:00 -0500 (EST) Received: from lerlaptop.iadfw.net (lerlaptop.iadfw.net [206.66.13.21]) by postgresql.org (Postfix) with ESMTP id A1CBD477592 for ; Thu, 23 Jan 2003 15:30:37 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by lerlaptop.iadfw.net (8.12.6/8.12.6) with ESMTP id h0NKUV5h003393; Thu, 23 Jan 2003 14:30:35 -0600 (CST) (envelope-from ler@lerctr.org) Date: Thu, 23 Jan 2003 14:30:31 -0600 From: Larry Rosenman To: Ben Siders , pgsql-sql@postgresql.org Subject: Re: SQL to list databases? Message-ID: <60030000.1043353831@lerlaptop.iadfw.net> In-Reply-To: <3E303AF2.10603@cms-stl.com> References: <81132473206F3A46A72BD6116E1A06AE1B14CC@black.aprote.com> <26610.1043341252@sss.pgh.pa.us> <3E303AF2.10603@cms-stl.com> X-Mailer: Mulberry/3.0.0b12 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: by amavisd-milter (http://amavis.org/) X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/372 X-Sequence-Number: 11237 --On Thursday, January 23, 2003 12:56:50 -0600 Ben Siders 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