Re: Strange behavior with timestamptz

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Strange behavior with timestamptz
Дата
Msg-id 7688.1061903326@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Strange behavior with timestamptz  ("George Weaver" <georgew1@mts.net>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: postgres 7.1.3: why does the query plan ignore indexes?
Следующее
От: "George Weaver"
Дата:
Сообщение: Re: Strange behavior with timestamptz