mirror of
https://github.com/postgres/postgres.git
synced 2025-10-16 17:07:43 +03:00
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.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.143 2007/03/18 16:50:44 neilc Exp $
|
||||
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.144 2007/03/26 16:58:39 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2440,6 +2440,7 @@ _getObjectDescription(PQExpBuffer buf, TocEntry *te, ArchiveHandle *AH)
|
||||
|
||||
/* objects named by just a name */
|
||||
if (strcmp(type, "DATABASE") == 0 ||
|
||||
strcmp(type, "PROCEDURAL LANGUAGE") == 0 ||
|
||||
strcmp(type, "SCHEMA") == 0)
|
||||
{
|
||||
appendPQExpBuffer(buf, "%s %s", type, fmtId(te->tag));
|
||||
@@ -2583,6 +2584,7 @@ _printTocEntry(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt, bool isDat
|
||||
strcmp(te->desc, "OPERATOR") == 0 ||
|
||||
strcmp(te->desc, "OPERATOR CLASS") == 0 ||
|
||||
strcmp(te->desc, "OPERATOR FAMILY") == 0 ||
|
||||
strcmp(te->desc, "PROCEDURAL LANGUAGE") == 0 ||
|
||||
strcmp(te->desc, "SCHEMA") == 0 ||
|
||||
strcmp(te->desc, "TABLE") == 0 ||
|
||||
strcmp(te->desc, "TYPE") == 0 ||
|
||||
@@ -2603,7 +2605,6 @@ _printTocEntry(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt, bool isDat
|
||||
strcmp(te->desc, "DEFAULT") == 0 ||
|
||||
strcmp(te->desc, "FK CONSTRAINT") == 0 ||
|
||||
strcmp(te->desc, "INDEX") == 0 ||
|
||||
strcmp(te->desc, "PROCEDURAL LANGUAGE") == 0 ||
|
||||
strcmp(te->desc, "RULE") == 0 ||
|
||||
strcmp(te->desc, "TRIGGER") == 0)
|
||||
{
|
||||
|
Reference in New Issue
Block a user