File tree 2 files changed +18
-7
lines changed
2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 1
1
<!--
2
- $PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.198 2007/12/11 19:57:32 tgl Exp $
2
+ $PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.199 2008/03/30 18:10:20 tgl Exp $
3
3
PostgreSQL documentation
4
4
-->
5
5
@@ -1328,9 +1328,12 @@ Tue Oct 26 21:40:57 CEST 1999
1328
1328
<term><literal>\l+</literal> (or <literal>\list+</literal>)</term>
1329
1329
<listitem>
1330
1330
<para>
1331
- List the names, owners, and character set encodings of all the databases in
1332
- the server. If <literal>+</literal> is appended to the command
1333
- name, database descriptions are also displayed.
1331
+ List the names, owners, character set encodings, and access privileges
1332
+ of all the databases in the server.
1333
+ If <literal>+</literal> is appended to the command name, database
1334
+ sizes, default tablespaces, and descriptions are also displayed.
1335
+ (Size information is only available for databases that the current
1336
+ user can connect to.)
1334
1337
</para>
1335
1338
</listitem>
1336
1339
</varlistentry>
Original file line number Diff line number Diff line change 3
3
*
4
4
* Copyright (c) 2000-2008, PostgreSQL Global Development Group
5
5
*
6
- * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.165 2008/03/30 17:50:11 tgl Exp $
6
+ * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.166 2008/03/30 18:10:20 tgl Exp $
7
7
*/
8
8
#include "postgres_fe.h"
9
9
#include "describe.h"
@@ -417,12 +417,20 @@ listAllDbs(bool verbose)
417
417
printfPQExpBuffer (& buf ,
418
418
"SELECT d.datname as \"%s\",\n"
419
419
" r.rolname as \"%s\",\n"
420
- " pg_catalog.pg_encoding_to_char(d.encoding) as \"%s\"" ,
420
+ " pg_catalog.pg_encoding_to_char(d.encoding) as \"%s\",\n"
421
+ " d.datacl as \"%s\"" ,
421
422
gettext_noop ("Name" ),
422
423
gettext_noop ("Owner" ),
423
- gettext_noop ("Encoding" ));
424
+ gettext_noop ("Encoding" ),
425
+ gettext_noop ("Access Privileges" ));
424
426
if (verbose )
425
427
{
428
+ appendPQExpBuffer (& buf ,
429
+ ",\n CASE WHEN pg_catalog.has_database_privilege(d.datname, 'CONNECT')\n"
430
+ " THEN pg_catalog.pg_size_pretty(pg_catalog.pg_database_size(d.datname))\n"
431
+ " ELSE 'No Access'\n"
432
+ " END as \"%s\"" ,
433
+ gettext_noop ("Size" ));
426
434
appendPQExpBuffer (& buf ,
427
435
",\n t.spcname as \"%s\"" ,
428
436
gettext_noop ("Tablespace" ));
You can’t perform that action at this time.
0 commit comments