Re: Primary key column numbers...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Justin Tocci <jtocci(at)tocci(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Primary key column numbers...
Date: 2005-05-31 19:17:38
Message-ID: 22729.1117567058@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bob Pawley 2005-05-31 19:24:04 Newby to DB
Previous Message Goulet, Dick 2005-05-31 18:59:03 Re: [ODBC] how to unsubscribe