Igor Khanjine <igor_kh@mailru.com> writes:
> select datop from mytable where date_trunc('month',datop)
> =date_trunc('month',abstime '02.05.00')
> it returns operations which were made in february !
> I'm running PGSQL 7.0 ,
> SET DATESTYLE ='GERMAN'
> SET TIME ZONE 'EUROPE/MOSCOW'
FWIW, I do not see this in 7.0.3-to-be:
play=> SET DATESTYLE ='GERMAN';
SET VARIABLE
play=> select abstime '02.05.00';
?column?
----------------------------
02.05.2000 00:00:00.00 EDT
(1 row)
play=> select date_trunc('month',abstime '02.05.00');
date_trunc
----------------------------
01.05.2000 00:00:00.00 EDT
(1 row)
Either it's been fixed since 7.0 release, or there is something peculiar
about the datetime support on your platform (which you didn't specify).
regards, tom lane