Re: A Table's Primary Key Listing
| От | Tom Lane |
|---|---|
| Тема | Re: A Table's Primary Key Listing |
| Дата | |
| Msg-id | 10279.1124395722@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: A Table's Primary Key Listing ("D'Arcy J.M. Cain" <darcy@druid.net>) |
| Ответы |
Re: A Table's Primary Key Listing
|
| Список | pgsql-sql |
"D'Arcy J.M. Cain" <darcy@druid.net> writes:
> That's a good question. The following query does this in a very
> unsatisfactory way. Anyone know what the general solution would be?
> ...
> (
> pg_index.indkey[0]=pg_attribute.attnum OR
> pg_index.indkey[1]=pg_attribute.attnum OR
> pg_index.indkey[2]=pg_attribute.attnum OR
> pg_index.indkey[3]=pg_attribute.attnum OR
> pg_index.indkey[4]=pg_attribute.attnum OR
> pg_index.indkey[5]=pg_attribute.attnum OR
> pg_index.indkey[6]=pg_attribute.attnum OR
> pg_index.indkey[7]=pg_attribute.attnum OR
> pg_index.indkey[8]=pg_attribute.attnum OR
> pg_index.indkey[9]=pg_attribute.attnum
> )
In CVS tip you could replace this with "attnum = ANY (indkey)".
Unfortunately, most array support doesn't work on int2vector in
pre-8.1 releases, so I think you're kinda stuck with the above
for now.
regards, tom lane
В списке pgsql-sql по дате отправления: