Search Postgresql Archives

case when evaluating else condition anyway?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux