summaryrefslogtreecommitdiff
path: root/src/bin/psql
diff options
context:
space:
mode:
authorTom Lane2012-12-09 05:08:23 +0000
committerTom Lane2012-12-09 05:08:23 +0000
commitb46c92112bf5afb2476d951b9817ebd8daa7b753 (patch)
tree3588d916ca3a2d71a0094cd72d889cc400ab2ba9 /src/bin/psql
parenta99c42f291421572aef2b0a9360294c7d89b8bc7 (diff)
Fix assorted bugs in privileges-for-types patch.
Commit 729205571e81b4767efc42ad7beb53663e08d1ff added privileges on data types, but there were a number of oversights. The implementation of default privileges for types missed a few places, and pg_dump was utterly innocent of the whole concept. Per bug #7741 from Nathan Alden, and subsequent wider investigation.
Diffstat (limited to 'src/bin/psql')
-rw-r--r--src/bin/psql/describe.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 15d02eeeff1..a1c31582fe6 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -14,6 +14,8 @@
#include <ctype.h>
+#include "catalog/pg_default_acl.h"
+
#include "common.h"
#include "describe.h"
#include "dumputils.h"
@@ -774,7 +776,7 @@ permissionsList(const char *pattern)
/*
* \ddp
*
- * List DefaultACLs. The pattern can match either schema or role name.
+ * List Default ACLs. The pattern can match either schema or role name.
*/
bool
listDefaultACLs(const char *pattern)
@@ -796,13 +798,18 @@ listDefaultACLs(const char *pattern)
printfPQExpBuffer(&buf,
"SELECT pg_catalog.pg_get_userbyid(d.defaclrole) AS \"%s\",\n"
" n.nspname AS \"%s\",\n"
- " CASE d.defaclobjtype WHEN 'r' THEN '%s' WHEN 'S' THEN '%s' WHEN 'f' THEN '%s' END AS \"%s\",\n"
+ " CASE d.defaclobjtype WHEN '%c' THEN '%s' WHEN '%c' THEN '%s' WHEN '%c' THEN '%s' WHEN '%c' THEN '%s' END AS \"%s\",\n"
" ",
gettext_noop("Owner"),
gettext_noop("Schema"),
+ DEFACLOBJ_RELATION,
gettext_noop("table"),
+ DEFACLOBJ_SEQUENCE,
gettext_noop("sequence"),
+ DEFACLOBJ_FUNCTION,
gettext_noop("function"),
+ DEFACLOBJ_TYPE,
+ gettext_noop("type"),
gettext_noop("Type"));
printACLColumn(&buf, "d.defaclacl");