From 65d6e4cb5c62371dae6c236a7e709d503ae6ddf8 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Wed, 18 Dec 2013 23:42:44 +0900 Subject: Add ALTER SYSTEM command to edit the server configuration file. Patch contributed by Amit Kapila. Reviewed by Hari Babu, Masao Fujii, Boszormenyi Zoltan, Andres Freund, Greg Smith and others. --- doc/src/sgml/config.sgml | 13 +++++ doc/src/sgml/ref/allfiles.sgml | 1 + doc/src/sgml/ref/alter_system.sgml | 114 +++++++++++++++++++++++++++++++++++++ doc/src/sgml/reference.sgml | 1 + doc/src/sgml/storage.sgml | 6 ++ 5 files changed, 135 insertions(+) create mode 100644 doc/src/sgml/ref/alter_system.sgml (limited to 'doc/src') diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index f0794467ba4..5575df51602 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -158,6 +158,19 @@ SET ENABLE_SEQSCAN TO OFF; require superuser permission to change via SET or ALTER. + + + Another way to change configuration parameters persistently is by + use of + command, for example: + +ALTER SYSTEM SET checkpoint_timeout TO 600; + + This command will allow users to change values persistently + through SQL command. The values will be effective after reload of server configuration + (SIGHUP) or server startup. The effect of this command is similar to when + user manually changes values in postgresql.conf. + diff --git a/doc/src/sgml/ref/allfiles.sgml b/doc/src/sgml/ref/allfiles.sgml index 5846974feb9..ce7a5e3cb6c 100644 --- a/doc/src/sgml/ref/allfiles.sgml +++ b/doc/src/sgml/ref/allfiles.sgml @@ -30,6 +30,7 @@ Complete list of usable sgml source files in this directory. + diff --git a/doc/src/sgml/ref/alter_system.sgml b/doc/src/sgml/ref/alter_system.sgml new file mode 100644 index 00000000000..3ccc6afd516 --- /dev/null +++ b/doc/src/sgml/ref/alter_system.sgml @@ -0,0 +1,114 @@ + + + + + ALTER SYSTEM + 7 + SQL - Language Statements + + + + ALTER SYSTEM + change a server configuration parameter + + + + ALTER SYSTEM + + + + +ALTER SYSTEM SET configuration_parameter { TO | = } { value | 'value' | DEFAULT } + + + + + Description + + + ALTER SYSTEM writes the configuration parameter + values to the postgresql.auto.conf file. With + DEFAULT, it removes a configuration entry from + postgresql.auto.conf file. The values will be + effective after reload of server configuration (SIGHUP) or in next + server start based on the type of configuration parameter modified. + + + + This command is not allowed inside transaction block or function. + + + + See for other ways to set the parameters and + how they become effective. + + + + + Parameters + + + + configuration_parameter + + + Name of a settable run-time parameter. Available parameters are + documented in . + + + + + + value + + + New value of parameter. Values can be specified as string + constants, identifiers, numbers, or comma-separated lists of + these, as appropriate for the particular parameter. + DEFAULT can be written to specify to remove the + parameter and its value from postgresql.auto.conf + + + + + + + + Examples + + + Set the wal_level: + +ALTER SYSTEM SET wal_level = hot_standby; + + + + + Set the authentication_timeout: + +ALTER SYSTEM SET authentication_timeout = 10; + + + + + Compatibility + + + The ALTER SYSTEM statement is a + PostgreSQL extension. + + + + + See Also + + + + + + + + diff --git a/doc/src/sgml/reference.sgml b/doc/src/sgml/reference.sgml index d967f666b91..87e8e9ee8ff 100644 --- a/doc/src/sgml/reference.sgml +++ b/doc/src/sgml/reference.sgml @@ -58,6 +58,7 @@ &alterSchema; &alterSequence; &alterServer; + &alterSystem; &alterTable; &alterTableSpace; &alterTSConfig; diff --git a/doc/src/sgml/storage.sgml b/doc/src/sgml/storage.sgml index 09b3f1028c1..1f3f1f9bf97 100644 --- a/doc/src/sgml/storage.sgml +++ b/doc/src/sgml/storage.sgml @@ -125,6 +125,12 @@ Item Subdirectory containing WAL (Write Ahead Log) files + + postgresql.auto.conf + A file used for storing configuration parameters that are set by +ALTER SYSTEM + + postmaster.opts A file recording the command-line options the server was -- cgit v1.2.3