Re: 'show databases' in psql way?

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: 'show databases' in psql way?
Date: 2004-11-03 03:46:23
Message-ID: b34ce33d30d33dce75724a2c9620d8ec@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


To be pedantic about it, use:

SELECT pg_catalog.quote_ident(datname) AS database
FROM pg_catalog.pg_database ORDER BY 1;

or if using version 8 or higher:

SELECT pg_catalog.quote_ident(datname) AS database,
pg_catalog.quote_ident(spcname) AS tablespace
FROM pg_catalog.pg_database
JOIN pg_catalog.pg_tablespace t ON (dattablespace=t.oid)
ORDER BY 1;


- --
Greg Sabino Mullane greg(at)turnstep(dot)com
PGP Key: 0x14964AC8 200411022120

-----BEGIN PGP SIGNATURE-----

iD8DBQFBiFTSvJuQZxSWSsgRApflAJ0RiVndbc6u//cXX/S7uM8K91lWbgCfYVbC
MsRNWlP446AcvHm0UaGgEVo=
=S8Ft
-----END PGP SIGNATURE-----

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Andrew Sullivan 2004-11-03 12:01:00 Re: vacuum analyze slows sql query
Previous Message Ferindo Middleton Jr 2004-11-03 03:26:01 Insert/Update Perl Function involving two tables needing to by 'in sync'