Re: Strange behavior with timestamptz - Mailing list pgsql-sql

From Tom Lane
Subject Re: Strange behavior with timestamptz
Date
Msg-id 7688.1061903326@sss.pgh.pa.us
Whole thread Raw
In response to Strange behavior with timestamptz  ("George Weaver" <georgew1@mts.net>)
List pgsql-sql
> ... When the datereceived parameter was defined
> as type Date, it was actually arriving at the procedure as "11-08-2003" and
> "25-08-2003" in spite of showing up as indicated below.  When I redefined
> the datereceived parameter as type OdbcDate, it arrived correctly at the
> procedure as "2003-08-11" and "2003-08-25".

Yeah.  The first two formats are ambiguous, in Postgres' mind anyway.
With the US datestyle setting, it will first attempt to parse as mm-dd-yyyy
and if that fails try dd-mm-yyyy.  So you'd need to change the datestyle
to Euro to get dd-mm-yyyy input to be parsed reliably.

As of 7.4 this is being tightened up, btw --- it'll be mm-dd-yyyy or error.

But AFAICS this has nothing to do with a default now() insertion,
because that value is never converted to a string before it gets into
the stored column.
        regards, tom lane


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: postgres 7.1.3: why does the query plan ignore indexes?
Next
From: "George Weaver"
Date:
Subject: Re: Strange behavior with timestamptz