forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit388e71a
committed
Make timetz_zone() stable, and correct a bug for DYNTZ abbreviations.
Historically, timetz_zone() has used time(NULL) as the reference pointfor deciding whether DST is active. That means its result can changeintra-statement, requiring it to be marked VOLATILE (cf.35979e6).But that definition is pretty inconsistent with the way we deal withtimestamps elsewhere. Let's make it use the transaction start time("now()") as the reference point instead. That lets it be markedSTABLE, and also saves a kernel call per invocation.While at it, remove the function's use of pg_time_t and pg_localtime.Those are inconsistent with the other code in this area, which indeedcreated a bug: timetz_zone() delivered completely wrong answers ifthe zone was specified by a dynamic TZ abbreviation. (We need to dosomething about that in the back branches, but the fix will lookdifferent from this.)Aleksander Alekseev and Tom LaneDiscussion:https://postgr.es/m/CAJ7c6TOMG8zSNEZtCn5SPe+cCk3Lfxb71ZaQwT2F4T7PJ_t=KA@mail.gmail.com1 parent78aa616 commit388e71a
File tree
3 files changed
+16
-16
lines changed- src
- backend/utils/adt
- include/catalog
3 files changed
+16
-16
lines changedLines changed: 14 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1481 | 1481 |
| |
1482 | 1482 |
| |
1483 | 1483 |
| |
1484 |
| - | |
1485 |
| - | |
1486 |
| - | |
| 1484 | + | |
1487 | 1485 |
| |
1488 | 1486 |
| |
1489 | 1487 |
| |
| |||
3029 | 3027 |
| |
3030 | 3028 |
| |
3031 | 3029 |
| |
3032 |
| - | |
| 3030 | + | |
3033 | 3031 |
| |
3034 | 3032 |
| |
3035 | 3033 |
| |
| |||
3068 | 3066 |
| |
3069 | 3067 |
| |
3070 | 3068 |
| |
3071 |
| - | |
3072 |
| - | |
3073 |
| - | |
| 3069 | + | |
| 3070 | + | |
| 3071 | + | |
3074 | 3072 |
| |
3075 |
| - | |
3076 |
| - | |
| 3073 | + | |
3077 | 3074 |
| |
3078 | 3075 |
| |
3079 | 3076 |
| |
3080 | 3077 |
| |
3081 | 3078 |
| |
3082 | 3079 |
| |
3083 | 3080 |
| |
3084 |
| - | |
3085 |
| - | |
3086 |
| - | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
3087 | 3085 |
| |
3088 |
| - | |
3089 |
| - | |
| 3086 | + | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
3090 | 3090 |
| |
3091 | 3091 |
| |
3092 | 3092 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
56 |
| - | |
| 56 | + | |
57 | 57 |
| |
58 | 58 |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5953 | 5953 |
| |
5954 | 5954 |
| |
5955 | 5955 |
| |
5956 |
| - | |
| 5956 | + | |
5957 | 5957 |
| |
5958 | 5958 |
| |
5959 | 5959 |
| |
|
0 commit comments
Comments
(0)