1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Arrange for timezone names to be recognized case-insensitively; for

example SET TIME ZONE 'america/new_york' works now.  This seems a good
idea on general user-friendliness grounds, and is part of the solution
to the timestamp-input parsing problems I noted recently.
This commit is contained in:
Tom Lane
2006-10-16 19:58:27 +00:00
parent a2ebf81913
commit 0b35b01e7a
5 changed files with 195 additions and 78 deletions

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.176 2006/09/22 16:20:00 tgl Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.177 2006/10/16 19:58:26 tgl Exp $ -->
<chapter id="datatype">
<title id="datatype-title">Data Types</title>
@ -1593,12 +1593,12 @@ SELECT b, char_length(b) FROM test2;
linkend="datatype-datetime-time-table">
and <xref linkend="datatype-timezone-table">.) If a time zone is
specified in the input for <type>time without time zone</type>,
it is silently ignored. You can also always specify a date but it will
be ignored except for when you use a full time zone name like
it is silently ignored. You can also specify a date but it will
be ignored, except when you use a full time zone name like
<literal>America/New_York</literal>. In this case specifying the date
is compulsory in order to tell which time zone offset should be
applied. It will be applied whatever time zone offset was valid at that
date and time at the specified place.
is required in order to determine whether standard or daylight-savings
time applies. The appropriate time zone offset is recorded in the
<type>time with time zone</type> value.
</para>
<table id="datatype-datetime-time-table">
@ -1653,7 +1653,7 @@ SELECT b, char_length(b) FROM test2;
</row>
<row>
<entry><literal>04:05:06 PST</literal></entry>
<entry>time zone specified by name</entry>
<entry>time zone specified by abbreviation</entry>
</row>
<row>
<entry><literal>2003-04-12 04:05:06 America/New_York</literal></entry>
@ -2214,6 +2214,12 @@ January 8 04:05:06 1999 PST
will always know the correct UTC offset for your region.
</para>
<para>
In all cases, timezone names are recognized case-insensitively.
(This is a change from <productname>PostgreSQL</productname> versions
prior to 8.2, which were case-sensitive in some contexts and not others.)
</para>
<para>
Note that timezone names are <emphasis>not</> used for date/time output
&mdash; all supported output formats use numeric timezone displays to