Home > Archive > PostgreSQL Discussion > May 2005 > Re: Primary key column numbers...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Primary key column numbers...
Tom Lane

2005-05-31, 8:24 pm

Justin Tocci <jtocci@tocci.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, ('& #123;1}')::int2vecto
r[] 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

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql
.org

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com