Allow non-superuser database owners to create procedural languages.
Tom Lane <tgl@sss.pgh.pa.us>
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.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/catalogs.sgml | modified | +15 −2 |
| doc/src/sgml/ref/alter_language.sgml | modified | +15 −4 |
| doc/src/sgml/ref/create_language.sgml | modified | +16 −4 |
| doc/src/sgml/ref/drop_language.sgml | modified | +4 −2 |
| src/backend/catalog/aclchk.c | modified | +31 −7 |
| src/backend/commands/alter.c | modified | +5 −1 |
| src/backend/commands/proclang.c | modified | +136 −26 |
| src/backend/parser/gram.y | modified | +12 −4 |
| src/backend/tcop/utility.c | modified | +4 −1 |
| src/bin/pg_dump/pg_backup_archiver.c | modified | +3 −2 |
| src/bin/pg_dump/pg_dump.c | modified | +14 −2 |
| src/bin/psql/tab-complete.c | modified | +7 −2 |
| src/include/catalog/catversion.h | modified | +2 −2 |
| src/include/catalog/pg_language.h | modified | +14 −12 |
| src/include/catalog/pg_pltemplate.h | modified | +14 −12 |
| src/include/commands/proclang.h | modified | +1 −0 |
| src/include/utils/acl.h | modified | +2 −1 |