variable
- A settable run-time parameter.
+ A settable run-time parameter.
value
- New value of parameter. DEFAULT can be
- used to specify resetting the parameter to its default
- value. Lists of strings are allowed, but more complex
- constructs may need to be single or double quoted.
+ New value of parameter. DEFAULT can be
+ used to specify resetting the parameter to its default
+ value. Lists of strings are allowed, but more complex
+ constructs may need to be single or double quoted.
+
- The DateStyle option is really only intended
- for porting applications. To format your date/time values to
- choice, use the to_char family of
+ SET DATESTYLE affects interpretation of
+ input and provides several standard output formats. For
+ applications needing different variations or tighter control
+ over input or output, consider using
+ the to_char family of
functions.
Set the style of date to traditional
PostgreSQL with European conventions:
-
+
SET DATESTYLE TO PostgreSQL,European;
-
+
+
- Set the time zone for Berkeley, California, using double quotes to
+ Set the time zone for Berkeley, California, using quotes to
preserve the uppercase attributes of the time zone specifier (note
- that the date/time format is ISO here):
+ that the date style is PostgreSQL for this
+ example):
-
+
SET TIME ZONE 'PST8PDT';
SELECT CURRENT_TIMESTAMP AS today;
-
- today
-------------------------
- 1998-03-31 07:41:21-08
->
+ today
+------------------------------------
+ Tue Feb 26 07:32:21.42834 2002 PST
+
+ >
- Set the time zone for Italy (note the required single or double quotes to handle
+ Set the time zone for Italy (note the required single quotes to handle
the special characters):
-
+
SET TIME ZONE 'Europe/Rome';
SELECT CURRENT_TIMESTAMP AS today;
today
------------------------
1998-03-31 17:41:31+02
-
+
- The second syntax shown above (SET TIME ZONE )
- attempts to mimic
SQL92 . However, SQL allows
- only numeric time zone offsets. All other parameter settings as
- well as the first syntax shown above are a
+ SET TIME ZONE
+ extends syntax defined in
+ only numeric time zone offsets while
+
PostgreSQL allows full time zone
+ specifier strings as well. All other SET
+ features are a