diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-03-26 16:58:41 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-03-26 16:58:41 +0000 |
commit | 55a7cf80a0769d38f03bd728717da855902041b1 (patch) | |
tree | 147a3aa02b95844de61c869232c2dbe802914e67 /src/bin/pg_dump/pg_dump.c | |
parent | 66daeb074b3fbdb071a5631c066f5e41d554220e (diff) | |
download | postgresql-55a7cf80a0769d38f03bd728717da855902041b1.tar.gz postgresql-55a7cf80a0769d38f03bd728717da855902041b1.zip |
Allow non-superuser database owners to create procedural languages.
A DBA is allowed to create a language in his database if it's marked
"tmpldbacreate" in pg_pltemplate. The factory default is that this is set
for all standard trusted languages, but of course a superuser may adjust
the settings. In service of this, add the long-foreseen owner column to
pg_language; renaming, dropping, and altering owner of a PL now follow
normal ownership rules instead of being superuser-only.
Jeremy Drake, with some editorialization by Tom Lane.
Diffstat (limited to 'src/bin/pg_dump/pg_dump.c')
-rw-r--r-- | src/bin/pg_dump/pg_dump.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 61bf13eb4fd..b0c9e70a46f 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -12,7 +12,7 @@ * by PostgreSQL * * IDENTIFICATION - * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.464 2007/03/22 20:47:12 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.465 2007/03/26 16:58:39 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -4030,7 +4030,19 @@ getProcLangs(int *numProcLangs) /* Make sure we are in proper schema */ selectSourceSchema("pg_catalog"); - if (g_fout->remoteVersion >= 80100) + if (g_fout->remoteVersion >= 80300) + { + /* pg_language has a lanowner column */ + appendPQExpBuffer(query, "SELECT tableoid, oid, " + "lanname, lanpltrusted, lanplcallfoid, " + "lanvalidator, lanacl, " + "(%s lanowner) as lanowner " + "FROM pg_language " + "WHERE lanispl " + "ORDER BY oid", + username_subquery); + } + else if (g_fout->remoteVersion >= 80100) { /* Languages are owned by the bootstrap superuser, OID 10 */ appendPQExpBuffer(query, "SELECT tableoid, oid, *, " |