]> granicus.if.org Git - postgresql/blobdiff - src/backend/utils/misc/guc.c
Document and enforce that the usable range of setseed() arguments is
[postgresql] / src / backend / utils / misc / guc.c
index a222eb9023ebb36f9591c4eee7273b68ba16db09..49958cb4e7f3ab74c62a82ecf89b6fb80294fe11 100644 (file)
@@ -6,11 +6,11 @@
  * See src/backend/utils/misc/README for more information.
  *
  *
- * Copyright (c) 2000-2007, PostgreSQL Global Development Group
+ * Copyright (c) 2000-2008, PostgreSQL Global Development Group
  * Written by Peter Eisentraut <peter_e@gmx.net>.
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.428 2007/12/28 00:23:23 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.436 2008/03/10 12:39:23 tgl Exp $
  *
  *--------------------------------------------------------------------
  */
@@ -110,6 +110,7 @@ extern int  CommitDelay;
 extern int     CommitSiblings;
 extern char *default_tablespace;
 extern char *temp_tablespaces;
+extern bool synchronize_seqscans;
 extern bool fullPageWrites;
 
 #ifdef TRACE_SORT
@@ -208,7 +209,7 @@ bool                SQL_inheritance = true;
 bool           Password_encryption = true;
 
 int                    log_min_error_statement = ERROR;
-int                    log_min_messages = NOTICE;
+int                    log_min_messages = WARNING;
 int                    client_min_messages = NOTICE;
 int                    log_min_duration_statement = -1;
 int                    log_temp_files = -1;
@@ -1052,6 +1053,15 @@ static struct config_bool ConfigureNamesBool[] =
                false, NULL, NULL
        },
 
+       {
+               {"synchronize_seqscans", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
+                       gettext_noop("Enable synchronized sequential scans."),
+                       NULL
+               },
+               &synchronize_seqscans,
+               true, NULL, NULL
+       },
+
        {
                {"archive_mode", PGC_POSTMASTER, WAL_SETTINGS,
                        gettext_noop("Allows archiving of WAL files using archive_command."),
@@ -1185,16 +1195,10 @@ static struct config_int ConfigureNamesInt[] =
        },
 
        /*
-        * Note: There is some postprocessing done in PostmasterMain() to make
-        * sure the buffers are at least twice the number of backends, so the
-        * constraints here are partially unused. Similarly, the superuser
-        * reserved number is checked to ensure it is less than the max backends
-        * number.
-        *
-        * MaxBackends is limited to INT_MAX/4 because some places compute
-        * 4*MaxBackends without any overflow check.  This check is made on
+        * Note: MaxBackends is limited to INT_MAX/4 because some places compute
+        * 4*MaxBackends without any overflow check.  This check is made in
         * assign_maxconnections, since MaxBackends is computed as MaxConnections
-        * + autovacuum_max_workers.
+        * plus autovacuum_max_workers.
         *
         * Likewise we have to limit NBuffers to INT_MAX/2.
         */
@@ -1831,7 +1835,7 @@ static struct config_real ConfigureNamesReal[] =
 
        {
                {"bgwriter_lru_multiplier", PGC_SIGHUP, RESOURCES,
-                       gettext_noop("Background writer multiplier on average buffers to scan per round."),
+                       gettext_noop("Multiple of the average buffer usage to free per round."),
                        NULL
                },
                &bgwriter_lru_multiplier,
@@ -1845,7 +1849,7 @@ static struct config_real ConfigureNamesReal[] =
                        GUC_NO_SHOW_ALL | GUC_NO_RESET_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE
                },
                &phony_random_seed,
-               0.5, 0.0, 1.0, assign_random_seed, show_random_seed
+               0.0, -1.0, 1.0, assign_random_seed, show_random_seed
        },
 
        {
@@ -1931,7 +1935,7 @@ static struct config_string ConfigureNamesString[] =
                                                 "includes all the levels that follow it.")
                },
                &log_min_messages_str,
-               "notice", assign_log_min_messages, NULL
+               "warning", assign_log_min_messages, NULL
        },
 
        {
@@ -2022,7 +2026,7 @@ static struct config_string ConfigureNamesString[] =
 
        {
                {"session_replication_role", PGC_SUSET, CLIENT_CONN_STATEMENT,
-                       gettext_noop("Sets the sessions behavior for triggers and rewrite rules."),
+                       gettext_noop("Sets the session's behavior for triggers and rewrite rules."),
                        gettext_noop("Each session can be either"
                                                 " \"origin\", \"replica\", or \"local\".")
                },
@@ -4829,6 +4833,16 @@ GUC_complaint_elevel(GucSource source)
                 */
                elevel = IsUnderPostmaster ? DEBUG3 : LOG;
        }
+       else if (source == PGC_S_OVERRIDE)
+       {
+               /*
+                * If we're a postmaster child, this is probably "undo" during
+                * transaction abort, so we don't want to clutter the log.  There's
+                * a small chance of a real problem with an OVERRIDE setting,
+                * though, so suppressing the message entirely wouldn't be desirable.
+                */
+               elevel = IsUnderPostmaster ? DEBUG5 : LOG;
+       }
        else if (source < PGC_S_INTERACTIVE)
                elevel = LOG;
        else