"Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com> 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