Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit022fd99

Browse files
committed
Fix up some problems in handling of zic-style time zone names in datetime
input routines. Remove the former "DecodePosixTimezone" function in favor ofletting the zic code handle POSIX-style zone specs (see tzparse()). Inparticular this means that "PST+3" now means the same as "-03", whereas itused to mean "-11" --- the zone abbreviation is effectively just a noise wordin this syntax. Make sure that all named and POSIX-style zone names will beparsed as a single token. Fix long-standing bogosities in printing and inputof fractional-hour timezone offsets (since the tzparse() code will acceptthese, we'd better make 'em work). Also correct an error in the originalcoding of the zic-zone-name patch: in "timestamp without time zone" input,zone names are supposed to be allowed but ignored, but the coding was suchthat the zone changed the interpretation anyway.
1 parentd58f09e commit022fd99

File tree

8 files changed

+214
-300
lines changed

8 files changed

+214
-300
lines changed

‎doc/src/sgml/datatype.sgml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.177 2006/10/16 19:58:26 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.178 2006/10/17 21:03:20 tgl Exp $ -->
22

33
<chapter id="datatype">
44
<title id="datatype-title">Data Types</title>
@@ -1675,12 +1675,16 @@ SELECT b, char_length(b) FROM test2;
16751675
<tbody>
16761676
<row>
16771677
<entry><literal>PST</literal></entry>
1678-
<entry>Pacific Standard Time</entry>
1678+
<entry>Abbreviation (forPacific Standard Time)</entry>
16791679
</row>
16801680
<row>
16811681
<entry><literal>America/New_York</literal></entry>
16821682
<entry>Full time zone name</entry>
16831683
</row>
1684+
<row>
1685+
<entry><literal>PST8PDT</literal></entry>
1686+
<entry>POSIX-style time zone specification</entry>
1687+
</row>
16841688
<row>
16851689
<entry><literal>-8:00</literal></entry>
16861690
<entry>ISO-8601 offset for PST</entry>
@@ -2183,7 +2187,7 @@ January 8 04:05:06 1999 PST
21832187
<listitem>
21842188
<para>
21852189
In addition to the timezone names and abbreviations,
2186-
<productname>PostgreSQL</productname> will accept time zone
2190+
<productname>PostgreSQL</productname> will acceptPOSIX-styletime zone
21872191
specifications of the form <replaceable>STD</><replaceable>offset</> or
21882192
<replaceable>STD</><replaceable>offset</><replaceable>DST</>, where
21892193
<replaceable>STD</> is a zone abbreviation, <replaceable>offset</> is a
@@ -2220,12 +2224,6 @@ January 8 04:05:06 1999 PST
22202224
prior to 8.2, which were case-sensitive in some contexts and not others.)
22212225
</para>
22222226

2223-
<para>
2224-
Note that timezone names are <emphasis>not</> used for date/time output
2225-
&mdash; all supported output formats use numeric timezone displays to
2226-
avoid ambiguity.
2227-
</para>
2228-
22292227
<para>
22302228
Neither full names nor abbreviations are hard-wired into the server;
22312229
they are obtained from configuration files stored under

‎doc/src/sgml/datetime.sgml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/datetime.sgml,v 2.54 2006/09/22 16:35:55 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/datetime.sgml,v 2.55 2006/10/17 21:03:20 tgl Exp $ -->
22

33
<appendix id="datetime-appendix">
44
<title>Date/Time Support</title>
@@ -46,9 +46,9 @@
4646
<para>
4747
If the numeric token contains a dash (<literal>-</>), slash
4848
(<literal>/</>), or two or more dots (<literal>.</>), this is
49-
a date string which may have a text month.In case of a slash
50-
(<literal>/</>)itcan also be a fulltime zone name like
51-
<literal>America/New_York</>.
49+
a date string which may have a text month. If a date token has
50+
already been seen,itis instead interpreted as atime zone
51+
name (e.g.,<literal>America/New_York</>).
5252
</para>
5353
</step>
5454

@@ -64,7 +64,7 @@
6464
<step>
6565
<para>
6666
If the token starts with a plus (<literal>+</>) or minus
67-
(<literal>-</>), then it is either a time zone or a special
67+
(<literal>-</>), then it is either anumerictime zone or a special
6868
field.
6969
</para>
7070
</step>
@@ -73,30 +73,24 @@
7373

7474
<step>
7575
<para>
76-
If the token is a text string, match up with possible strings.
76+
If the token is a text string, match up with possible strings:
7777
</para>
7878

7979
<substeps>
8080
<step>
8181
<para>
82-
Do a binary-search table lookup for the token
83-
as either a special string (e.g., <literal>today</literal>),
84-
day (e.g., <literal>Thursday</literal>),
85-
month (e.g., <literal>January</literal>),
86-
or noise word (e.g., <literal>at</literal>, <literal>on</literal>).
87-
</para>
88-
89-
<para>
90-
Set field values and bit mask for fields.
91-
For example, set year, month, day for <literal>today</literal>,
92-
and additionally hour, minute, second for <literal>now</literal>.
82+
Do a binary-search table lookup for the token as a time zone
83+
abbreviation.
9384
</para>
9485
</step>
9586

9687
<step>
9788
<para>
9889
If not found, do a similar binary-search table lookup to match
99-
the token with a time zone.
90+
the token as either a special string (e.g., <literal>today</literal>),
91+
day (e.g., <literal>Thursday</literal>),
92+
month (e.g., <literal>January</literal>),
93+
or noise word (e.g., <literal>at</literal>, <literal>on</literal>).
10094
</para>
10195
</step>
10296

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp