Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita1e5331

Browse files
committed
Add tablespace display to psql \l+.
Philip Yarra
1 parent525de8d commita1e5331

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

‎src/bin/psql/describe.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.133 2006/03/0515:58:51 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.134 2006/04/26 23:15:45 momjian Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"describe.h"
@@ -362,14 +362,21 @@ listAllDbs(bool verbose)
362362
",\n pg_catalog.pg_encoding_to_char(d.encoding) as \"%s\"",
363363
_("Encoding"));
364364
if (verbose)
365+
{
366+
appendPQExpBuffer(&buf,
367+
",\n t.spcname as \"%s\"",
368+
_("Tablespace"));
365369
appendPQExpBuffer(&buf,
366370
",\n pg_catalog.shobj_description(d.oid, 'pg_database') as \"%s\"",
367371
_("Description"));
372+
}
368373
appendPQExpBuffer(&buf,
369374
"\nFROM pg_catalog.pg_database d"
370-
"\n JOIN pg_catalog.pg_roles r ON d.datdba = r.oid\n"
371-
"ORDER BY 1;");
372-
375+
"\n JOIN pg_catalog.pg_roles r ON d.datdba = r.oid\n");
376+
if (verbose)
377+
appendPQExpBuffer(&buf,
378+
" JOIN pg_catalog.pg_tablespace t on d.dattablespace = t.oid\n");
379+
appendPQExpBuffer(&buf,"ORDER BY 1;");
373380
res=PSQLexec(buf.data, false);
374381
termPQExpBuffer(&buf);
375382
if (!res)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp