This is my first template

Поиск
Список
Период
Сортировка
От Geoff Caplan
Тема This is my first template
Дата
Msg-id 200904211103.n3LB329b023342@rs48.luxsci.com
обсуждение исходный текст
Ответы Re: This is my first template  (Sam Mason <sam@samason.me.uk>)
Re: This is my first template  (Merlin Moncure <mmoncure@gmail.com>)
Re: This is my first template  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-general
Hi folks

Looks like there's something I'm not understanding about
date/time queries on a date field.

I have a param query that includes the statement:

AND active_from_date <= $2

where $2 is a well-formed ISO date.

Query works as expected when there are records in the result
set. When the result set is empty, PG throws an error:

date/time field value out of range: "2011-4-31"

I'm using the default datestyle setting, which should work
here, I think? Experimenting with other settings hasn't helped.

This query runs hundreds of times a day and I don't want the
error clogging up my logs. But I don't want to suppress the
error as the query is business-critical and I need to know
if anything goes wrong.

I'd welcome suggestions as to how I can get this query to
run without throwing a date/time error when the result set
is empty.

Thanks...

--
Geoff Caplan
Uviva Ltd


Вложения

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

Предыдущее
От: "Albe Laurenz"
Дата:
Сообщение: Re: trouble with to_char('L')
Следующее
От: Sam Mason
Дата:
Сообщение: Re: This is my first template