case when evaluating else condition anyway?

Поиск
Список
Период
Сортировка
От Ivan Sergio Borgonovo
Тема case when evaluating else condition anyway?
Дата
Msg-id 20081126145307.7ad8b1eb@dawn.webthatworks.it
обсуждение исходный текст
Ответы Re: case when evaluating else condition anyway?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: case when evaluating else condition anyway?  (Sam Mason <sam@samason.me.uk>)
Список pgsql-general
I've

case when ''=extinput then null else extinput::timestamp end

now when extinput='' it seems that else extinput::timestamp get
evaluated anyway and I get:

invalid input syntax for type timestamp: ""

The purpose of all this gymnic would be to convert empty string to
null and everything else to a timestamp.

Is there any cleaner functional way that doesn't involve prepared
statement etc... since the whole exercise is caused by an
null-impaired DB API (aka MySQLish).

--
Ivan Sergio Borgonovo
http://www.webthatworks.it


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: slow, long-running 'commit prepared'
Следующее
От: Tom Lane
Дата:
Сообщение: Re: case when evaluating else condition anyway?