Peter Eisentraut <peter_e@gmx.net> writes:
> However, if you do
> - (CASE WHEN 0<(select count(*) from pg_views where viewname = relname)
> - THEN 'view' ELSE 'table' END)
> + 'relation'
> if works fine. No nested CASE's?
Nope: no sub-selects in target list.
I'm hoping to fix that soon, but if you want psql to continue to work
with pre-6.6 backends then you'll have to use a different approach.
regards, tom lane