Commit c4a7a392 authored by Peter Eisentraut's avatar Peter Eisentraut

Make allow_system_table_mods settable at run time

Make allow_system_table_mods settable at run time by superusers.  It
was previously postmaster start only.

We don't want to make system catalog DDL wide-open, but there are
occasionally useful things to do like setting reloptions or statistics
on a busy system table, and blocking those doesn't help anyone.  Also,
this enables the possibility of writing a test suite for this setting.
Reviewed-by: default avatarTom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/8b00ea5e-28a7-88ba-e848-21528b632354%402ndquadrant.com
parent 508bf95b
...@@ -9501,9 +9501,11 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir' ...@@ -9501,9 +9501,11 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
</term> </term>
<listitem> <listitem>
<para> <para>
Allows modification of the structure of system tables. Allows modification of the structure of system tables as well as
This is used by <command>initdb</command>. certain other risky actions on system tables. This is otherwise not
This parameter can only be set at server start. allowed even for superusers. Ill-advised use of this setting can
cause irretrievable data loss or seriously corrupt the database
system. Only superusers can change this setting.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
......
...@@ -1777,7 +1777,7 @@ static struct config_bool ConfigureNamesBool[] = ...@@ -1777,7 +1777,7 @@ static struct config_bool ConfigureNamesBool[] =
}, },
{ {
{"allow_system_table_mods", PGC_POSTMASTER, DEVELOPER_OPTIONS, {"allow_system_table_mods", PGC_SUSET, DEVELOPER_OPTIONS,
gettext_noop("Allows modifications of the structure of system tables."), gettext_noop("Allows modifications of the structure of system tables."),
NULL, NULL,
GUC_NOT_IN_SAMPLE GUC_NOT_IN_SAMPLE
......
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