Re: Incorrect "invalid AM/PM string" error from to_timestamp

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Incorrect "invalid AM/PM string" error from to_timestamp
Дата
Msg-id 8148.1222359751@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Incorrect "invalid AM/PM string" error from to_timestamp  ("Joshua Tolley" <eggyknap@gmail.com>)
Ответы Re: Incorrect "invalid AM/PM string" error from to_timestamp  ("Alex Hunsaker" <badalex@gmail.com>)
Список pgsql-bugs
"Joshua Tolley" <eggyknap@gmail.com> writes:
> I'm running this on 8.4devel built from CVS HEAD as of 9:44 AM Moutain
> Daylight time today, on a 32-bit Ubuntu 7.04 box. This is a completely
> new database.

Ugh, apparently there's some state-dependent bug in the recent
to_timestamp fixes:

regression=# \c -
psql (8.4devel)
You are now connected to database "regression".
regression=# select to_timestamp('21-SEP-08 08.15.42.950620 PM', 'DD-MON-YY HH.MI.SS.US AM');
         to_timestamp
------------------------------
 2008-09-21 08:15:42.95062-04
(1 row)

regression=# select to_timestamp('21-SEP-08 08.15.42.950620 PM', 'DD-MON-YY HH.MI.SS.US AM');
ERROR:  invalid AM/PM string
regression=#

Yes, those are the same command.  The error is repeatable on subsequent
executions in the same session.

A likely bet is that this is caused by use of uninitialized memory,
which happens to have garbage rather than zeroes in it the second
time through.

Brendan, do you have time to look into this?

BTW, the error message is pretty unhelpful: ISTM it really ought to show
the value it's complaining of.

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Joshua Tolley"
Дата:
Сообщение: Incorrect "invalid AM/PM string" error from to_timestamp
Следующее
От: "Tim Leppard"
Дата:
Сообщение: BUG #4437: Breaking referential integrity with a trigger