From a1e5331b0745438efce46b3c9e1649a81d57796e Mon Sep 17 00:00:00 2001 From: Bruce Momjian <bruce@momjian.us> Date: Wed, 26 Apr 2006 23:15:45 +0000 Subject: [PATCH] Add tablespace display to psql \l+. Philip Yarra --- src/bin/psql/describe.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index d12fa1266a2..6bb6b591e20 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2006, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.133 2006/03/05 15:58:51 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.134 2006/04/26 23:15:45 momjian Exp $ */ #include "postgres_fe.h" #include "describe.h" @@ -362,14 +362,21 @@ listAllDbs(bool verbose) ",\n pg_catalog.pg_encoding_to_char(d.encoding) as \"%s\"", _("Encoding")); if (verbose) + { + appendPQExpBuffer(&buf, + ",\n t.spcname as \"%s\"", + _("Tablespace")); appendPQExpBuffer(&buf, ",\n pg_catalog.shobj_description(d.oid, 'pg_database') as \"%s\"", _("Description")); + } appendPQExpBuffer(&buf, "\nFROM pg_catalog.pg_database d" - "\n JOIN pg_catalog.pg_roles r ON d.datdba = r.oid\n" - "ORDER BY 1;"); - + "\n JOIN pg_catalog.pg_roles r ON d.datdba = r.oid\n"); + if (verbose) + appendPQExpBuffer(&buf, + " JOIN pg_catalog.pg_tablespace t on d.dattablespace = t.oid\n"); + appendPQExpBuffer(&buf,"ORDER BY 1;"); res = PSQLexec(buf.data, false); termPQExpBuffer(&buf); if (!res) -- GitLab