Re: Strange query results with dates - Mailing list pgsql-general

From Tom Lane
Subject Re: Strange query results with dates
Date
Msg-id 8233.972311084@sss.pgh.pa.us
Whole thread Raw
In response to Strange query results with dates  (Igor Khanjine <igor_kh@mailru.com>)
Responses Re[2]: Strange query results with dates  (igor <igor_kh@mailru.com>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Igor Khanjine
Date:
Subject: Strange query results with dates
Next
From: Tom Lane
Date:
Subject: Re: blobs dont rollback ?