1998-09-24
-SET variable { TO | = } {
- 'value' | DEFAULT }
-SET TIME ZONE { 'timezone' | LOCAL | DEFAULT };
+SET variable { TO | = } { 'value' | DEFAULT }
+SET TIME ZONE { 'timezone' | LOCAL | DEFAULT }
SET TRANSACTION ISOLATION LEVEL { READ COMMITTED | SERIALIZED }
- variable
+variable
- value
+value
- CLIENT_ENCODING | NAMES
+CLIENT_ENCODING | NAMES
- Sets the multi-byte client encoding
+ Sets the multi-byte client encoding. Parameters are:
- value
+value
- DEFAULT
+DEFAULT
- Sets the multi-byte client encoding.
+ Sets the multi-byte client encoding to the default value.
- DateStyle
+DateStyle
+ Set the date/time representation style. Affects the output format,
+ and in some cases it can affect the interpretation of input.
+
- ISO
+ISO
- SQL
+SQL
- Postgres
+Postgres
- European
+European
- NonEuropean
+NonEuropean
- German
+German
- US
+US
- default
+default
- Date format initialization my be done by:
+ Date format initialization may be done by:
- Setting PGDATESTYLE environment variable.
+ Setting the PGDATESTYLE environment variable.
- Running postmaster using -oe parameter to set
- dates to the 'European' convention.
+ Running postmaster using the parameter to set
+ dates to the European convention.
Note that this affects only the some combinations of date styles; for example
the ISO style is not affected by this parameter.
- SERVER_ENCODING
+SERVER_ENCODING
- value
+value
- Sets the multi-byte server encoding.
+ Sets the multi-byte server encoding.
- DEFAULT
+DEFAULT
- Sets the multi-byte server encoding.
+ Sets the multi-byte server encoding.
- TIMEZONE
+TIMEZONE
- 'PST8PDT'
+'PST8PDT'
- 'Portugal'
+'Portugal'
- 'Europe/Rome'
+'Europe/Rome'
- DEFAULT
+DEFAULT
- TRANSACTION ISOLATION LEVEL
+TRANSACTION ISOLATION LEVEL
- READ COMMITTED
+READ COMMITTED
- SERIALIZABLE
+SERIALIZABLE
- COST_HEAP
+COST_HEAP
- float4
+float4
- DEFAULT
+DEFAULT
- COST_INDEX
+COST_INDEX
- float4
+float4
- DEFAULT
+DEFAULT
- GEQO
+GEQO
- ON
+ON
- ON=#
+ON=#
- OFF
+OFF
- DEFAULT
+DEFAULT
- KSQO
+KSQO
- ON
+ON
- OFF
+OFF
- DEFAULT
+DEFAULT
- SET VARIABLE
+SET VARIABLE
- WARN: Bad value for
- variable
- (value)
+WARN: Bad value for variable (value)
Usage
-
- --Set the style of date to ISO:
- --
+ Set the style of date to ISO:
+
SET DATESTYLE TO 'ISO';
-
- --Enable GEQO for queries with 4 or more tables
- --
+
+
+ Enable GEQO for queries with 4 or more tables:
+
SET GEQO ON=4;
-
- --Set GEQO to default:
- --
+
+
+ Set GEQO to default:
+
SET GEQO = DEFAULT;
-
- --set the timezone for Berkeley, California:
+
+
+ Set the timezone for Berkeley, California:
+
SET TIME ZONE 'PST8PDT';
-
SELECT CURRENT_TIMESTAMP AS today;
today
----------------------
1998-03-31 07:41:21-08
-
- --set the timezone for Italy:
+
+
+ Set the timezone for Italy:
+
SET TIME ZONE 'Europe/Rome';
-
SELECT CURRENT_TIMESTAMP AS today;
today
----------------------
1998-03-31 17:41:31+02
-
-
+
+