pg-mem icon indicating copy to clipboard operation
pg-mem copied to clipboard

Subtracting interval from dates gives the wrong output.

Open Alexnortung opened this issue 10 months ago • 0 comments

Describe the bug

Subtracting dates with intervals seems to give the wrong output. for example, subtracting one year from 2022-01-01 returns 2021-01-06. But in postgres it produces the expected 2021-01-01.

To Reproduce

SELECT '2022-01-01'::date - interval '1 year';
SELECT '2022-01-01'::date - interval '1 month';

pg-mem version

Used playground

Alexnortung avatar Mar 27 '24 12:03 Alexnortung