Re: case when evaluating else condition anyway?

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: case when evaluating else condition anyway?
Дата
Msg-id 20081126141844.GX2459@frubble.xen.chris-lamb.co.uk
обсуждение исходный текст
Ответ на case when evaluating else condition anyway?  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Ответы Re: case when evaluating else condition anyway?  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Список pgsql-general
On Wed, Nov 26, 2008 at 02:53:07PM +0100, Ivan Sergio Borgonovo wrote:
> case when ''=extinput then null else extinput::timestamp end

I'd tend to use nullif(extinput,'')::timestamp for this sort of thing.
It's not going to do anything much different from what you're doing, but
may end up evaluating "extinput" less which may be a good thing.

> 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).

As Tom said, maybe if you could send a larger example it would help.


  Sam

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: case when evaluating else condition anyway?
Следующее
От: "Ronald Vyhmeister"
Дата:
Сообщение: Problem with langage encoding