Commit 93a1fce5 authored by Bruce Momjian's avatar Bruce Momjian

Add permission display to \db+.

parent a837ed88
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.118 2004/07/13 16:48:15 momjian Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.119 2004/07/15 03:56:04 momjian Exp $
PostgreSQL documentation
-->
......@@ -832,6 +832,8 @@ testdb=>
Lists all available tablespaces. If <replaceable
class="parameter">pattern</replaceable>
is specified, only tablespaces whose names match the pattern are shown.
If <literal>+</literal> is appended to the command name, each object
is listed with its associated permissions.
</para>
</listitem>
</varlistentry>
......
......@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.121 2004/07/13 16:48:16 momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.122 2004/07/15 03:56:06 momjian Exp $
*/
#include "postgres_fe.h"
#include "command.h"
......@@ -302,7 +302,7 @@ exec_command(const char *cmd,
success = describeAggregates(pattern, show_verbose);
break;
case 'b':
success = describeTablespaces(pattern);
success = describeTablespaces(pattern, show_verbose);
break;
case 'c':
success = listConversions(pattern);
......
......@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.102 2004/07/13 16:48:16 momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.103 2004/07/15 03:56:06 momjian Exp $
*/
#include "postgres_fe.h"
#include "describe.h"
......@@ -106,7 +106,7 @@ describeAggregates(const char *pattern, bool verbose)
* Takes an optional regexp to select particular tablespaces
*/
bool
describeTablespaces(const char *pattern)
describeTablespaces(const char *pattern, bool verbose)
{
PQExpBufferData buf;
PGresult *res;
......@@ -117,10 +117,17 @@ describeTablespaces(const char *pattern)
printfPQExpBuffer(&buf,
"SELECT spcname AS \"%s\",\n"
" pg_catalog.pg_get_userbyid(spcowner) AS \"%s\",\n"
" spclocation AS \"%s\"\n"
"FROM pg_catalog.pg_tablespace\n",
" spclocation AS \"%s\"",
_("Name"), _("Owner"), _("Location"));
if (verbose)
appendPQExpBuffer(&buf,
",\n spcacl as \"%s\"",
_("Access privileges"));
appendPQExpBuffer(&buf,
"\nFROM pg_catalog.pg_tablespace\n");
processNamePattern(&buf, pattern, false, false,
NULL, "spcname", NULL,
NULL);
......
......@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/describe.h,v 1.25 2004/07/13 16:48:16 momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/describe.h,v 1.26 2004/07/15 03:56:06 momjian Exp $
*/
#ifndef DESCRIBE_H
#define DESCRIBE_H
......@@ -14,7 +14,7 @@
bool describeAggregates(const char *pattern, bool verbose);
/* \db */
bool describeTablespaces(const char *pattern);
bool describeTablespaces(const char *pattern, bool verbose);
/* \df */
bool describeFunctions(const char *pattern, bool verbose);
......
......@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.89 2004/07/13 16:48:16 momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.90 2004/07/15 03:56:06 momjian Exp $
*/
#include "postgres_fe.h"
#include "common.h"
......@@ -211,7 +211,7 @@ slashUsage(unsigned short int pager)
fprintf(output, _(" \\d{t|i|s|v|S} [PATTERN] (add \"+\" for more detail)\n"
" list tables/indexes/sequences/views/system tables\n"));
fprintf(output, _(" \\da [PATTERN] list aggregate functions\n"));
fprintf(output, _(" \\db [PATTERN] list tablespaces\n"));
fprintf(output, _(" \\db [PATTERN] list tablespaces (add \"+\" for more detail)\n"));
fprintf(output, _(" \\dc [PATTERN] list conversions\n"));
fprintf(output, _(" \\dC list casts\n"));
fprintf(output, _(" \\dd [PATTERN] show comment for object\n"));
......
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