You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The standard says that at routine invocation, "the value of the original time zone displacement is set to the value of the current time zone displacement" during the call.
The original time zone cannot be changed by the user, but SET TIME ZONE TO LOCAL resets the current time zone to the original one.
So in fact the standard expects that the code below returns "America/New_York, America/Los_Angeles" but we instead return "America/New_York, America/Sao_Paulo".
We have some complications (like selectable procedure or execute statements) that should also be taken into account.
------------
execute block returns (t1 timestamp with time zone, t2 timestamp with time zone)
as
declare procedure p0 returns (t1 timestamp with time zone, t2 timestamp with time zone)
as
begin
set time zone 'America/New_York';
t1 = current_timestamp;
set time zone local;
t2 = current_timestamp;
end
declare procedure p1 returns (t1 timestamp with time zone, t2 timestamp with time zone)
as
begin
set time zone 'America/Los_Angeles';
execute procedure p0 returning\_values t1, t2;
end
begin
-- Initial time zone: 'America/Sao_Paulo';
Submitted by: @asfernandes
The standard says that at routine invocation, "the value of the original time zone displacement is set to the value of the current time zone displacement" during the call.
The original time zone cannot be changed by the user, but SET TIME ZONE TO LOCAL resets the current time zone to the original one.
So in fact the standard expects that the code below returns "America/New_York, America/Los_Angeles" but we instead return "America/New_York, America/Sao_Paulo".
We have some complications (like selectable procedure or execute statements) that should also be taken into account.
------------
execute block returns (t1 timestamp with time zone, t2 timestamp with time zone)
as
declare procedure p0 returns (t1 timestamp with time zone, t2 timestamp with time zone)
as
begin
set time zone 'America/New_York';
t1 = current_timestamp;
set time zone local;
t2 = current_timestamp;
end
declare procedure p1 returns (t1 timestamp with time zone, t2 timestamp with time zone)
as
begin
set time zone 'America/Los_Angeles';
end
begin
-- Initial time zone: 'America/Sao_Paulo';
execute procedure p1 returning_values t1, t2;
suspend;
end!
------------
Commits: a64b202
The text was updated successfully, but these errors were encountered: