Skip to content

[pull] master from postgres:master#1245

Merged
pull[bot] merged 1 commit intoMu-L:masterfrom
postgres:master
Sep 6, 2021
Merged

[pull] master from postgres:master#1245
pull[bot] merged 1 commit intoMu-L:masterfrom
postgres:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull bot commented Sep 6, 2021

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

Historically, timetz_zone() has used time(NULL) as the reference point
for deciding whether DST is active.  That means its result can change
intra-statement, requiring it to be marked VOLATILE (cf. 35979e6).
But that definition is pretty inconsistent with the way we deal with
timestamps elsewhere.  Let's make it use the transaction start time
("now()") as the reference point instead.  That lets it be marked
STABLE, 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 indeed
created a bug: timetz_zone() delivered completely wrong answers if
the zone was specified by a dynamic TZ abbreviation.  (We need to do
something about that in the back branches, but the fix will look
different from this.)

Aleksander Alekseev and Tom Lane

Discussion: https://postgr.es/m/CAJ7c6TOMG8zSNEZtCn5SPe+cCk3Lfxb71ZaQwT2F4T7PJ_t=KA@mail.gmail.com
@pull pull bot added the ⤵️ pull label Sep 6, 2021
@pull pull bot merged commit 388e71a into Mu-L:master Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant