forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd7674c9
committed
Seek zone abbreviations in the IANA data before timezone_abbreviations.
If a time zone abbreviation used in datetime input is defined inthe currently active timezone, use that definition in preferenceto looking in the timezone_abbreviations list. That allows us tocorrectly handle abbreviations that have different meanings indifferent timezones. Also, it eliminates an inconsistency betweendatetime input and datetime output: the non-ISO datestyles fortimestamptz have always printed abbreviations taken from the IANAdata, not from timezone_abbreviations. Before this fix, it waspossible to demonstrate cases where casting a timestamp to textand back fails or changes the value significantly because of thatinconsistency.While this change removes the ability to override the IANA data aboutan abbreviation known in the current zone, it's not clear that there'sany real use-case for doing so. But it is clear that this makes lifea lot easier for dealing with abbreviations that have conflicts acrossdifferent time zones.Also update the pg_timezone_abbrevs view to report abbreviationsthat are recognized via the IANA data, and *not* report anytimezone_abbreviations entries that are thereby overridden.Under the hood, there are now two SRFs, one that pulls the IANAdata and one that pulls timezone_abbreviations entries. They'recombined by logic in the view. This approach was useful fordebugging (since the functions can be called on their own).While I don't intend to document the functions explicitly,they might be useful to call directly.Also improve DecodeTimezoneAbbrev's caching logic so that it cancache zone abbreviations found in the IANA data. Without that,this patch would have caused a noticeable degradation of theruntime of timestamptz_in.Per report from Aleksander Alekseev and additional investigation.Discussion:https://postgr.es/m/CAJ7c6TOATjJqvhnYsui0=CO5XFMF4dvTGH+skzB--jNhqSQu5g@mail.gmail.com1 parentbc10219 commitd7674c9
File tree
20 files changed
+521
-35
lines changed- doc/src/sgml
- src
- backend
- catalog
- commands
- utils/adt
- include
- catalog
- utils
- test/regress
- expected
- sql
- timezone
- tools/pgindent
20 files changed
+521
-35
lines changedLines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10054 | 10054 |
| |
10055 | 10055 |
| |
10056 | 10056 |
| |
10057 |
| - | |
10058 |
| - | |
| 10057 | + | |
| 10058 | + | |
| 10059 | + | |
| 10060 | + | |
10059 | 10061 |
| |
10060 | 10062 |
| |
10061 | 10063 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2534 | 2534 |
| |
2535 | 2535 |
| |
2536 | 2536 |
| |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
2537 | 2541 |
| |
2538 | 2542 |
| |
2539 | 2543 |
| |
|
Lines changed: 38 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
80 | 80 |
| |
81 | 81 |
| |
82 | 82 |
| |
83 |
| - | |
| 83 | + | |
84 | 84 |
| |
85 | 85 |
| |
86 | 86 |
| |
| |||
424 | 424 |
| |
425 | 425 |
| |
426 | 426 |
| |
427 |
| - | |
428 |
| - | |
429 |
| - | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
430 | 464 |
| |
431 | 465 |
| |
432 | 466 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4566 | 4566 |
| |
4567 | 4567 |
| |
4568 | 4568 |
| |
4569 |
| - | |
| 4569 | + | |
| 4570 | + | |
| 4571 | + | |
4570 | 4572 |
| |
4571 | 4573 |
| |
4572 | 4574 |
| |
|
Lines changed: 6 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
634 | 634 |
| |
635 | 635 |
| |
636 | 636 |
| |
637 |
| - | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
638 | 643 |
| |
639 | 644 |
| |
640 | 645 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
381 | 381 |
| |
382 | 382 |
| |
383 | 383 |
| |
| 384 | + | |
| 385 | + | |
384 | 386 |
| |
385 | 387 |
| |
386 | 388 |
| |
|
0 commit comments
Comments
(0)