SET variable { TO | = } { value | 'value' | DEFAULT } SET TIME ZONE { 'timezone' | LOCAL | DEFAULT }
Use this parameter to name the run-time variable you are setting.
Use this parameter to supply a new value for the specified variable. Use 'DEFAULT' to reset the variable to its default value.
This message is displayed if the variable is successfully set.
This error is displayed if you try to set a variable that doesn't exist.
This error is displayed if you do not have adequate permissions to alter the specified variable.
This error is displayed if you attempt to set a variable that can only bet set upon startup.
Use the SET command to modify PostgreSQL run-time configuration variables. The following variable can be altered.
This variable sets the multi-byte client encoding scheme.
This variable sets the date and time representation style. When setting this variable, you can choose one format from the normal output styles, one of the two substyles, or both an output style and a substyle. Initialization of the format can be performed by manually changing the PGDATESTYLE environment variable, or running postmaster with -o -e to set dates to the European format.
The following are valid date and time output styles.
ISO 8601 style date and time formatting. Date and time are displayed as YYYY-MM-DD HH:MM:SS. This is the default style.
Oracle/Ingres style date and time formatting. Despite this format's label, it is not the SQL default; SQL uses ISO 8601 style formatting.
Traditional PostgreSQL date and time formatting.
German style formatting. Numeric date representations are displayed as DD.MM.YYYY.
European style formatting. This is a substyle of the "SQL" and "PostgreSQL" styles. Numeric date representations are displayed as DD/MM/YYYY.
United States style formatting. This is a substyle of the "SQL" and "Postgres" styles. Numeric date representations are displayed as MM/DD/YYYY.
This variable sets the internal seed for the PostgreSQL random number generator.
This value specifies the seed to be used by the random function. Allowed values are floating point numbers between 0 and 1. The number you supply is then multiplied by 2^31-1.
Alternatively, you may set the seed by calling the SQL setseed command, such as: SELECT setseed(value);.
This value specifies the seed to be used by the random function. Allowed values are floating point numbers between 0 and 1. The number you supply is then multiplied by 2^31-1.
Alternatively, you may set the seed by calling the SQL setseed command, such as: SELECT setseed(value);.
This variable sets the multi-byte server encoding.
This variable sets the time zone. The available options for this variable are dependent upon your operating system. On a linux machine, the time zone data would probably be stored in /usr/lib/zoneinfo. Whatever the available settings on your system are, the following entries should be valid for use with this keyword,
Set time zone to California.
Sets time zone to Portugal.
Sets time zone to Italy.
This sets the time zone to your local time zone. This is the default system time zone.
The following examples set the date and time display styles.
This example sets the DATESTYLE variable to use traditional PostgreSQL style formatting. It also sets the sub-style to US, which uses additional United States-specific formatting.
SET DATESTYLE TO Postgres,US;
The next example sets the date and time formatting to ISO.
SET DATESTYLE TO ISO;