Commit a1e5331b authored by Bruce Momjian's avatar Bruce Momjian

Add tablespace display to psql \l+.

Philip Yarra
parent 525de8d5
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright (c) 2000-2006, PostgreSQL Global Development Group * 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 "postgres_fe.h"
#include "describe.h" #include "describe.h"
...@@ -362,14 +362,21 @@ listAllDbs(bool verbose) ...@@ -362,14 +362,21 @@ listAllDbs(bool verbose)
",\n pg_catalog.pg_encoding_to_char(d.encoding) as \"%s\"", ",\n pg_catalog.pg_encoding_to_char(d.encoding) as \"%s\"",
_("Encoding")); _("Encoding"));
if (verbose) if (verbose)
{
appendPQExpBuffer(&buf,
",\n t.spcname as \"%s\"",
_("Tablespace"));
appendPQExpBuffer(&buf, appendPQExpBuffer(&buf,
",\n pg_catalog.shobj_description(d.oid, 'pg_database') as \"%s\"", ",\n pg_catalog.shobj_description(d.oid, 'pg_database') as \"%s\"",
_("Description")); _("Description"));
}
appendPQExpBuffer(&buf, appendPQExpBuffer(&buf,
"\nFROM pg_catalog.pg_database d" "\nFROM pg_catalog.pg_database d"
"\n JOIN pg_catalog.pg_roles r ON d.datdba = r.oid\n" "\n JOIN pg_catalog.pg_roles r ON d.datdba = r.oid\n");
"ORDER BY 1;"); 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); res = PSQLexec(buf.data, false);
termPQExpBuffer(&buf); termPQExpBuffer(&buf);
if (!res) if (!res)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment