When running the following query, I would expect it to give the same result independently of the session time zone but instead it gives different result depending on the session:
select '2025-09-22' >= date_trunc('week', '2025-09-22 13:20:24.951556+02'::timestamptz, 'UTC')
It gives true when executed within session that has set time zone 'UTC';
It gives false when executed within session that has set time zone 'Europe/Copenhagen';
The Postgresql version:
select version();
-- PostgreSQL 17.5 on aarch64-unknown-linux-gnu, compiled by gcc (GCC) 12.4.0, 64-bit
Can someone explain why it acts differently when I specify the time zone on the date_trunc function to be 'UTC'?