Re: date style bug

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: date style bug
Дата
Msg-id 14908.995898324@sss.pgh.pa.us
обсуждение исходный текст
Ответ на date style bug  (Felipe Alvarez Harnecker <felipe@qlsoft.cl>)
Список pgsql-bugs
Felipe Alvarez Harnecker <felipe@qlsoft.cl> writes:
> obelix3=> set datestyle=postgres,euro;
> SET VARIABLE

> obelix3=> select * from orden_visita where fecha_emision <= 'today'::date;
> ERROR:  Bad date external representation '07-17-2001'

Since '07-17-2001' is *not* a valid date in Euro convention
(dd-mm-yyyy), I don't see any bug here.

I take it fecha_emision is a text or varchar field that your query is
casting to date on-the-fly.  Perhaps you'd be better advised to use
datatype date (or timestamp) for the field in the first place.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: create view bug
Следующее
От: Tom Lane
Дата:
Сообщение: Re: create view bug