aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-09-09 17:59:11 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-09-09 17:59:11 -0400
commitca4af308c32d03db5fbacb54d6e583ceb904f268 (patch)
tree352fb06319a1c8e3efd78acaca9cc8b8ff0e7eda /doc/src
parenta7801b62f21bd051444bd1119cd3745ecc8e14ec (diff)
downloadpostgresql-ca4af308c32d03db5fbacb54d6e583ceb904f268.tar.gz
postgresql-ca4af308c32d03db5fbacb54d6e583ceb904f268.zip
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.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/config.sgml14
-rw-r--r--doc/src/sgml/datatype.sgml21
-rw-r--r--doc/src/sgml/ref/set.sgml4
3 files changed, 11 insertions, 28 deletions
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 <xref linkend="guc-timezone">, 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 <xref
- linkend="datatype-timezones"> for more information.
+ The built-in default is <literal>GMT</>, but that is typically
+ overridden in <filename>postgresql.conf</>; <application>initdb</>
+ will install a setting there corresponding to its system environment.
+ See <xref linkend="datatype-timezones"> for more information.
This parameter can only be set in the <filename>postgresql.conf</>
file or on the server command line.
</para>
@@ -4963,9 +4964,10 @@ SET XML OPTION { DOCUMENT | CONTENT };
<listitem>
<para>
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 <xref
- linkend="datatype-timezones"> for more information.
+ The built-in default is <literal>GMT</>, but that is typically
+ overridden in <filename>postgresql.conf</>; <application>initdb</>
+ will install a setting there corresponding to its system environment.
+ See <xref linkend="datatype-timezones"> for more information.
</para>
</listitem>
</varlistentry>
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.
<productname>PostgreSQL</productname> uses the widely-used
- <literal>zoneinfo</> time zone database for information about
+ <literal>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,28 +2432,11 @@ January 8 04:05:06 1999 PST
The <xref linkend="guc-timezone"> configuration parameter can
be set in the file <filename>postgresql.conf</>, or in any of the
other standard ways described in <xref linkend="runtime-config">.
- There are also several special ways to set it:
+ There are also some special ways to set it:
<itemizedlist>
<listitem>
<para>
- If <varname>timezone</> is not specified in
- <filename>postgresql.conf</> or as a server command-line option,
- the server attempts to use the value of the <envar>TZ</envar>
- environment variable as the default time zone. If <envar>TZ</envar>
- is not defined or is not any of the time zone names known to
- <productname>PostgreSQL</productname>, the server attempts to
- determine the operating system's default time zone by checking the
- behavior of the C library function <literal>localtime()</>. The
- default time zone is selected as the closest match among
- <productname>PostgreSQL</productname>'s known time zones.
- (These rules are also used to choose the default value of
- <xref linkend="guc-log-timezone">, if not specified.)
- </para>
- </listitem>
-
- <listitem>
- <para>
The <acronym>SQL</acronym> command <command>SET TIME ZONE</command>
sets the time zone for the session. This is an alternative spelling
of <command>SET TIMEZONE TO</> with a more SQL-spec-compatible syntax.
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(<replaceable>value</replaceable>);
<listitem>
<para>
Set the time zone to your local time zone (that is, the
- server's default value of <varname>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 <varname>timezone</>).
</para>
</listitem>
</varlistentry>