Fix up some problems in handling of zic-style time zone names in datetime
Tom Lane <tgl@sss.pgh.pa.us>
Fix up some problems in handling of zic-style time zone names in datetime input routines. Remove the former "DecodePosixTimezone" function in favor of letting the zic code handle POSIX-style zone specs (see tzparse()). In particular this means that "PST+3" now means the same as "-03", whereas it used to mean "-11" --- the zone abbreviation is effectively just a noise word in this syntax. Make sure that all named and POSIX-style zone names will be parsed as a single token. Fix long-standing bogosities in printing and input of fractional-hour timezone offsets (since the tzparse() code will accept these, we'd better make 'em work). Also correct an error in the original coding 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 such that the zone changed the interpretation anyway.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/datatype.sgml | modified | +7 −9 |
| doc/src/sgml/datetime.sgml | modified | +12 −18 |
| src/backend/utils/adt/datetime.c | modified | +151 −227 |
| src/test/regress/expected/horology.out | modified | +12 −12 |
| src/test/regress/expected/timestamp.out | modified | +18 −18 |
| src/test/regress/expected/timestamptz.out | modified | +5 −5 |
| src/test/regress/sql/timestamp.sql | modified | +5 −7 |
| src/test/regress/sql/timestamptz.sql | modified | +4 −4 |