By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
create table test(tstz timestamptz, ts timestamp);
insert into test
select '2012-08-24 14:00:00+03:00'::timestamptz,
'2012-08-24 14:00:00+03:00'::timestamp
returning *;
CREATE TABLE
tstz | ts |
---|---|
2012-08-24 11:00:00+00 | 2012-08-24 14:00:00 |
INSERT 0 1
set timezone='utc-03:00';
select tstz,ts from test;
SET
tstz | ts |
---|---|
2012-08-24 14:00:00+03 | 2012-08-24 14:00:00 |
SELECT 1
select to_char(tstz,'YYYY-MM-DD HH-MI-SSAMOF'),
to_char(ts,'YYYY-MM-DD HH-MI-SSAMOF') from test;
to_char | to_char |
---|---|
2012-08-24 02-00-00PM+03 | 2012-08-24 02-00-00PM+00 |
SELECT 1
--Standard time: Australian Central Western Standard Time (ACWST)
--Example city: Eucla
set timezone='UTC +8:45';
select tstz,ts from test;
SET
tstz | ts |
---|---|
2012-08-24 02:15:00-08:45 | 2012-08-24 14:00:00 |
SELECT 1
select to_char(tstz,'YYYY-MM-DD HH-MI-SSAMOF'),
to_char(ts,'YYYY-MM-DD HH-MI-SSAMOF') from test;
to_char | to_char |
---|---|
2012-08-24 02-15-00AM-08:45 | 2012-08-24 02-00-00PM+00 |
SELECT 1