Justin Tocci <jtocci(at)tocci(dot)org> writes:
> SELECT indkey
> FROM (SELECT relname, indkey
> FROM pg_catalog.pg_index join pg_catalog.pg_class
> ON pg_index.indrelid = pg_class.oid
> WHERE indisprimary=true
> UNION
> SELECT viewname, ('{1}')::int2vector[] as indkey
> FROM pg_catalog.pg_views ) t
> WHERE relname = '????'
> Result: ERROR: UNION/INTERSECT/EXCEPT could not convert type
> int2vector[] to int2vector
I think you want just
SELECT viewname, '1'::int2vector as indkey
for the second arm of the union.
regards, tom lane