Re: timestamp handling in postgres 7.1 behaves strange - Mailing list pgsql-bugs

From Thomas Lockhart
Subject Re: timestamp handling in postgres 7.1 behaves strange
Date
Msg-id 3B71D4D9.E82853E8@fourpalms.org
Whole thread Raw
In response to timestamp handling in postgres 7.1 behaves strange  (pgsql-bugs@postgresql.org)
List pgsql-bugs
> when comparing timestamps i always get
> ERROR:  Bad timestamp external representation 'm'
> this works:
> select timestamp (content) from factversionelement where factid=100311 and elementname='newsdate';
> ------------------------
>  2010-01-02 16:00:00+01
> this does not:
> select factid from factversionelement where factid=100311 and elementname='newsdate' and timestamp (content) >=
'2001-08-08';
> ERROR:  Bad timestamp external representation 'm'

In the first case, you are evaluating the timestamp only after the
"where qualifications" are met, so this is done on one row. In the
second case, the optimizer is probably having you evaluate
timestamp(content) ON ALL ROWS as the first pass. At least one of those
rows has a value which is incompatible with timestamp data.

Please state the schema of the factversionelement table. I will bet that
the "content" column is not in fact a timestamp type (it is some sort of
string type??), and does not contain strings which are entirely legal as
timestamps.

                      - Thomas

pgsql-bugs by date:

Previous
From: pgsql-bugs@postgresql.org
Date:
Subject: timestamp handling in postgres 7.1 behaves strange
Next
From: Tom Lane
Date:
Subject: Re: timestamp handling in postgres 7.1 behaves strange