From ca4af308c32d03db5fbacb54d6e583ceb904f268 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 9 Sep 2011 17:59:11 -0400 Subject: Simplify handling of the timezone GUC by making initdb choose the default. We were doing some amazingly complicated things in order to avoid running the very expensive identify_system_timezone() procedure during GUC initialization. But there is an obvious fix for that, which is to do it once during initdb and have initdb install the system-specific default into postgresql.conf, as it already does for most other GUC variables that need system-environment-dependent defaults. This means that the timezone (and log_timezone) settings no longer have any magic behavior in the server. Per discussion. --- doc/src/sgml/config.sgml | 14 ++++++++------ doc/src/sgml/datatype.sgml | 21 ++------------------- doc/src/sgml/ref/set.sgml | 4 +--- 3 files changed, 11 insertions(+), 28 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 615b2b078bf..f95f9cc8bd8 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -3915,9 +3915,10 @@ FROM pg_stat_activity; Sets the time zone used for timestamps written in the server log. Unlike , this value is cluster-wide, so that all sessions will report timestamps consistently. - If not explicitly set, the server initializes this variable to the - time zone specified by its system environment. See for more information. + The built-in default is GMT, but that is typically + overridden in postgresql.conf; initdb + will install a setting there corresponding to its system environment. + See for more information. This parameter can only be set in the postgresql.conf file or on the server command line. @@ -4963,9 +4964,10 @@ SET XML OPTION { DOCUMENT | CONTENT }; Sets the time zone for displaying and interpreting time stamps. - If not explicitly set, the server initializes this variable to the - time zone specified by its system environment. See for more information. + The built-in default is GMT, but that is typically + overridden in postgresql.conf; initdb + will install a setting there corresponding to its system environment. + See for more information. diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 89b531fa1d2..e7b3098f28f 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -2286,7 +2286,7 @@ January 8 04:05:06 1999 PST but continue to be prone to arbitrary changes, particularly with respect to daylight-savings rules. PostgreSQL uses the widely-used - zoneinfo time zone database for information about + zoneinfo (Olson) time zone database for information about historical time zone rules. For times in the future, the assumption is that the latest known rules for a given time zone will continue to be observed indefinitely far into the future. @@ -2432,26 +2432,9 @@ January 8 04:05:06 1999 PST The configuration parameter can be set in the file postgresql.conf, or in any of the other standard ways described in . - There are also several special ways to set it: + There are also some special ways to set it: - - - If timezone is not specified in - postgresql.conf or as a server command-line option, - the server attempts to use the value of the TZ - environment variable as the default time zone. If TZ - is not defined or is not any of the time zone names known to - PostgreSQL, the server attempts to - determine the operating system's default time zone by checking the - behavior of the C library function localtime(). The - default time zone is selected as the closest match among - PostgreSQL's known time zones. - (These rules are also used to choose the default value of - , if not specified.) - - - The SQL command SET TIME ZONE diff --git a/doc/src/sgml/ref/set.sgml b/doc/src/sgml/ref/set.sgml index 40e1bd4e607..21745db4627 100644 --- a/doc/src/sgml/ref/set.sgml +++ b/doc/src/sgml/ref/set.sgml @@ -239,9 +239,7 @@ SELECT setseed(value); Set the time zone to your local time zone (that is, the - server's default value of timezone; if this - has not been explicitly set anywhere, it will be the zone that - the server's operating system defaults to). + server's default value of timezone). -- cgit v1.2.3