Synopsis

Use the SET statement to update a run-time control parameter.

Syntax

set ::= SET [ SESSION | LOCAL ] { configuration_parameter { TO | = } 
                                  { value | DEFAULT }
                                  | TIME ZONE 
                                    { timezone | LOCAL | DEFAULT } }

set

SETSESSIONLOCALconfiguration_parameterTO=valueDEFAULTTIMEZONEtimezoneLOCALDEFAULT

Semantics

The parameter values that you set with this statement apply just within the scope of a single session and for no longer than the session's duration. It's also possible to set the default values for such parameters at the level of the entire cluster or at the level of a particular database. For example:

alter database demo set timezone = 'America/Los_Angeles';

See ALTER DATABASE.

SESSION

Specify that the command affects only the current session.

LOCAL

Specify that the command affects only the current transaction. After COMMIT or ROLLBACK, the session-level setting takes effect again.

configuration_parameter

Specify the name of a mutable run-time parameter.

value

Specify the value of parameter.

See also