- Notifications
You must be signed in to change notification settings - Fork5
Commitb2cbced
committed
Support timezone abbreviations that sometimes change.
Up to now, PG has assumed that any given timezone abbreviation (such as"EDT") represents a constant GMT offset in the usage of any particularregion; we had a way to configure what that offset was, but not for itto be changeable over time. But, as with most things horological, thisview of the world is too simplistic: there are numerous regions that haveat one time or another switched to a different GMT offset but kept usingthe same timezone abbreviation. Almost the entire Russian Federation didthat a few years ago, and later this month they're going to do it again.And there are similar examples all over the world.To cope with this, invent the notion of a "dynamic timezone abbreviation",which is one that is referenced to a particular underlying timezone(as defined in the IANA timezone database) and means whatever it currentlymeans in that zone. For zones that use or have used daylight-savings time,the standard and DST abbreviations continue to have the property that youcan specify standard or DST time and get that time offset whether or notDST was theoretically in effect at the time. However, the abbreviationsmean what they meant at the time in question (or most recently before thattime) rather than being absolutely fixed.The standard abbreviation-list files have been changed to use this behaviorfor abbreviations that have actually varied in meaning since 1970. Theold simple-numeric definitions are kept for abbreviations that have notchanged, since they are a bit faster to resolve.While this is clearly a new feature, it seems necessary to back-patch itinto all active branches, because otherwise use of Russian zoneabbreviations is going to become even more problematic than it already was.This change supersedes the changes in commit513d06d et al to modify thefixed meanings of the Russian abbreviations; since we've not shipped thatyet, this will avoid an undesirably incompatible (not to mention incorrect)change in behavior for timestamps between 2011 and 2014.This patch makes some cosmetic changes in ecpglib to keep its usage ofdatetime lookup tables as similar as possible to the backend code, butdoesn't do anything about the increasingly obsolete set of timezoneabbreviation definitions that are hard-wired into ecpglib. Whatever wedo about that will likely not be appropriate material for back-patching.Also, a potential free() of a garbage pointer after an out-of-memoryfailure in ecpglib has been fixed.This patch also fixes pre-existing bugs in DetermineTimeZoneOffset() thatcaused it to produce unexpected results near a timezone transition, ifboth the "before" and "after" states are marked as standard time. We'donly ever thought about or tested transitions between standard and DSTtime, but that's not what's happening when a zone simply redefines theirbase GMT offset.In passing, update the SGML documentation to refer to the Olson/zoneinfo/zic timezone database as the "IANA" database, since it's now beingmaintained under the auspices of IANA.1 parent90063a7 commitb2cbced
File tree
29 files changed
+2045
-664
lines changed- contrib/btree_gist
- doc/src/sgml
- src
- backend/utils
- adt
- misc
- include
- utils
- interfaces/ecpg/pgtypeslib
- test/regress
- expected
- sql
- timezone
- tznames
29 files changed
+2045
-664
lines changedLines changed: 3 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
200 | 200 |
| |
201 | 201 |
| |
202 | 202 |
| |
203 |
| - | |
| 203 | + | |
204 | 204 |
| |
205 | 205 |
| |
206 |
| - | |
207 |
| - | |
208 |
| - | |
209 |
| - | |
210 |
| - | |
211 |
| - | |
212 |
| - | |
213 |
| - | |
214 |
| - | |
215 |
| - | |
216 |
| - | |
217 |
| - | |
218 |
| - | |
219 |
| - | |
220 |
| - | |
221 |
| - | |
222 |
| - | |
223 |
| - | |
| 206 | + | |
| 207 | + | |
224 | 208 |
| |
225 | 209 |
| |
226 | 210 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6003 | 6003 |
| |
6004 | 6004 |
| |
6005 | 6005 |
| |
6006 |
| - | |
6007 |
| - | |
6008 |
| - | |
| 6006 | + | |
| 6007 | + | |
| 6008 | + | |
6009 | 6009 |
| |
6010 | 6010 |
| |
6011 | 6011 |
| |
|
Lines changed: 28 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2325 | 2325 |
| |
2326 | 2326 |
| |
2327 | 2327 |
| |
2328 |
| - | |
| 2328 | + | |
2329 | 2329 |
| |
2330 | 2330 |
| |
2331 | 2331 |
| |
| |||
2390 | 2390 |
| |
2391 | 2391 |
| |
2392 | 2392 |
| |
2393 |
| - | |
2394 |
| - | |
| 2393 | + | |
| 2394 | + | |
2395 | 2395 |
| |
2396 | 2396 |
| |
2397 | 2397 |
| |
| |||
2427 | 2427 |
| |
2428 | 2428 |
| |
2429 | 2429 |
| |
2430 |
| - | |
| 2430 | + | |
2431 | 2431 |
| |
2432 | 2432 |
| |
2433 | 2433 |
| |
| |||
2438 | 2438 |
| |
2439 | 2439 |
| |
2440 | 2440 |
| |
2441 |
| - | |
2442 |
| - | |
2443 |
| - | |
| 2441 | + | |
| 2442 | + | |
| 2443 | + | |
| 2444 | + | |
| 2445 | + | |
| 2446 | + | |
| 2447 | + | |
| 2448 | + | |
| 2449 | + | |
| 2450 | + | |
| 2451 | + | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
| 2457 | + | |
| 2458 | + | |
| 2459 | + | |
2444 | 2460 |
| |
2445 | 2461 |
| |
2446 | 2462 |
| |
| |||
2457 | 2473 |
| |
2458 | 2474 |
| |
2459 | 2475 |
| |
2460 |
| - | |
2461 |
| - | |
2462 |
| - | |
| 2476 | + | |
| 2477 | + | |
| 2478 | + | |
| 2479 | + | |
2463 | 2480 |
| |
2464 | 2481 |
| |
2465 | 2482 |
| |
2466 |
| - | |
| 2483 | + | |
2467 | 2484 |
| |
2468 | 2485 |
| |
2469 | 2486 |
| |
|
Lines changed: 20 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
374 | 374 |
| |
375 | 375 |
| |
376 | 376 |
| |
377 |
| - | |
378 |
| - | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
379 | 380 |
| |
380 | 381 |
| |
381 | 382 |
| |
382 | 383 |
| |
383 | 384 |
| |
384 | 385 |
| |
385 |
| - | |
386 |
| - | |
| 386 | + | |
| 387 | + | |
387 | 388 |
| |
388 | 389 |
| |
389 | 390 |
| |
390 |
| - | |
391 |
| - | |
392 |
| - | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
393 | 398 |
| |
394 | 399 |
| |
395 | 400 |
| |
| |||
400 | 405 |
| |
401 | 406 |
| |
402 | 407 |
| |
403 |
| - | |
404 |
| - | |
405 |
| - | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
406 | 411 |
| |
407 | 412 |
| |
408 | 413 |
| |
409 | 414 |
| |
410 | 415 |
| |
411 | 416 |
| |
412 | 417 |
| |
413 |
| - | |
| 418 | + | |
414 | 419 |
| |
415 | 420 |
| |
416 | 421 |
| |
417 | 422 |
| |
418 | 423 |
| |
419 | 424 |
| |
420 |
| - | |
| 425 | + | |
421 | 426 |
| |
422 | 427 |
| |
423 | 428 |
| |
| |||
426 | 431 |
| |
427 | 432 |
| |
428 | 433 |
| |
429 |
| - | |
430 |
| - | |
431 |
| - | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
432 | 437 |
| |
433 | 438 |
| |
434 | 439 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1108 | 1108 |
| |
1109 | 1109 |
| |
1110 | 1110 |
| |
1111 |
| - | |
| 1111 | + | |
1112 | 1112 |
| |
1113 | 1113 |
| |
1114 | 1114 |
| |
|
Lines changed: 23 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2695 | 2695 |
| |
2696 | 2696 |
| |
2697 | 2697 |
| |
2698 |
| - | |
2699 |
| - | |
2700 |
| - | |
2701 |
| - | |
2702 |
| - | |
2703 |
| - | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
2704 | 2704 |
| |
2705 | 2705 |
| |
| 2706 | + | |
| 2707 | + | |
2706 | 2708 |
| |
2707 | 2709 |
| |
2708 | 2710 |
| |
2709 | 2711 |
| |
2710 |
| - | |
| 2712 | + | |
2711 | 2713 |
| |
2712 | 2714 |
| |
2713 |
| - | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
2714 | 2728 |
| |
2715 | 2729 |
| |
| 2730 | + | |
2716 | 2731 |
| |
2717 | 2732 |
| |
2718 | 2733 |
| |
|
0 commit comments
Comments
(0)