Search Postgresql Archives

Re: case not sensitive to null condition ?

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

 



"Gauthier, Dave" <dave.gauthier@xxxxxxxxx> writes:
> thedb=# select
>   ''''||bicolumn||'''',
>   coalesce(permitted_values,'is_null'),
>   case permitted_values when NULL then 'null' else ''''||permitted_values||'''' end
>    from bi_constraints limit 2;

That's equivalent to "case when permitted_values = NULL then ..." which
doesn't work, because = never succeeds on nulls.  You need to write
something like "case when permitted_values IS NULL then ...".

			regards, tom lane


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