SET CONSTRAINTS

NameSET CONSTRAINTS -- set constraint check timing for the current transaction Synopsis SET CONSTRAINTS { ALL | name [, ...] } { DEFERRED | IMMEDIATE } Description SET CONSTRAINTS sets the behavior of constraint checking within the current transaction. IMMEDIATE constraints are checked at the end of each statement. DEFERRED constraints are not checked until transaction commit. Each constraint has its own IMMEDIATE or DEFERRED mode. Upon creation, a constraint is given one of three cha

SET

NameSET -- change a run-time parameter Synopsis SET [ SESSION | LOCAL ] configuration_parameter { TO | = } { value | 'value' | DEFAULT } SET [ SESSION | LOCAL ] TIME ZONE { timezone | LOCAL | DEFAULT } Description The SET command changes run-time configuration parameters. Many of the run-time parameters listed in Chapter 19 can be changed on-the-fly with SET. (But some require superuser privileges to change, and others cannot be changed after server or session start.) SET only affects

Server Configuration: Write Ahead Log

For additional information on tuning these settings, see Section 30.4. 19.5.1. Settings wal_level (enum) wal_level determines how much information is written to the WAL. The default value is minimal, which writes only the information needed to recover from a crash or immediate shutdown. replica adds logging required for WAL archiving as well as information required to run read-only queries on a standby server. Finally, logical adds information necessary to support logical decoding. Each lev

Server Configuration: Version and Platform Compatibility

19.13.1. Previous PostgreSQL Versions array_nulls (boolean) This controls whether the array input parser recognizes unquoted NULL as specifying a null array element. By default, this is on, allowing array values containing null values to be entered. However, PostgreSQL versions before 8.2 did not support null values in arrays, and therefore would treat NULL as specifying a normal array element with the string value "NULL". For backward compatibility with applications that require the old be

Server Configuration: Short Options

For convenience there are also single letter command-line option switches available for some parameters. They are described in Table 19-2. Some of these options exist for historical reasons, and their presence as a single-letter option does not necessarily indicate an endorsement to use the option heavily. Table 19-2. Short Option Key Short Option Equivalent -B x shared_buffers = x -d x log_min_messages = DEBUGx -e datestyle = euro -fb, -fh, -fi, -fm, -fn, -fo, -fs, -ft enable_bitmapscan =

Server Configuration: Setting Parameters

19.1.1. Parameter Names and Values All parameter names are case-insensitive. Every parameter takes a value of one of five types: boolean, string, integer, floating point, or enumerated (enum). The type determines the syntax for setting the parameter: Boolean: Values can be written as on, off, true, false, yes, no, 1, 0 (all case-insensitive) or any unambiguous prefix of one of these. String: In general, enclose the value in single quotes, doubling any single quotes within the value. Quotes

Server Configuration: Run-time Statistics

19.9.1. Query and Index Statistics Collector These parameters control server-wide statistics collection features. When statistics collection is enabled, the data that is produced can be accessed via the pg_stat and pg_statio family of system views. Refer to Chapter 28 for more information. track_activities (boolean) Enables the collection of information on the currently executing command of each session, along with the time when that command began execution. This parameter is on by default.

Server Configuration: Resource Consumption

19.4.1. Memory shared_buffers (integer) Sets the amount of memory the database server uses for shared memory buffers. The default is typically 128 megabytes (128MB), but might be less if your kernel settings will not support it (as determined during initdb). This setting must be at least 128 kilobytes. (Non-default values of BLCKSZ change the minimum.) However, settings significantly higher than the minimum are usually needed for good performance. This parameter can only be set at server st

Server Configuration: Replication

These settings control the behavior of the built-in streaming replication feature (see Section 26.2.5). Servers will be either a Master or a Standby server. Masters can send data, while Standby(s) are always receivers of replicated data. When cascading replication (see Section 26.2.7) is used, Standby server(s) can also be senders, as well as receivers. Parameters are mainly for Sending and Standby servers, though some parameters have meaning only on the Master server. Settings may vary across

Server Configuration: Query Planning

19.7.1. Planner Method Configuration These configuration parameters provide a crude method of influencing the query plans chosen by the query optimizer. If the default plan chosen by the optimizer for a particular query is not optimal, a temporary solution is to use one of these configuration parameters to force the optimizer to choose a different plan. Better ways to improve the quality of the plans chosen by the optimizer include adjusting the planer cost constants (see Section 19.7.2), runn