The following bug has been logged on the website:
Bug reference: 18518
Logged by: Nicola Oricchio
Email address: nicola.oricchio@vertigis.com
PostgreSQL version: 12.18
Operating system: Ubuntu
Description:
repro:
create table aaa (dat timestamp without time zone);
insert into aaa values ('1892-12-31 23:00:00');
insert into aaa values ('1893-12-31 23:00:00');
insert into aaa values ('1992-12-31 13:33:12');
select dat, (dat at time zone 'utc')::timestamp without time zone from aaa
order by 1;
output:
dat | timezone
---------------------+---------------------
1892-12-31 23:00:00 | 1893-12-31 23:53:28 <-- it should be 1893-01-01
00:00:00
1893-12-31 23:00:00 | 1894-01-01 00:00:00
1992-12-31 13:33:12 | 1992-12-31 14:33:12
it works correctly with 12.2
dat | timezone
---------------------+---------------------
1892-12-31 23:00:00 | 1893-01-01 00:00:00
1893-12-31 23:00:00 | 1894-01-01 00:00:00
1992-12-31 13:33:12 | 1992-12-31 14:33:12
time zone is CET