Re: array indizes in SQL

Поиск
Список
Период
Сортировка
Искать
От
Hans-Peter Oeri
Тема
Re: array indizes in SQL
Дата
Msg-id
4738671A.6000306@oeri.ch
Ответ на
Re: array indizes in SQL (Rodrigo De León)
Список
Дерево обсуждения
array indizes in SQL Hans-Peter Oeri <hp@oeri.ch>
Re: array indizes in SQL Tom Lane <tgl@sss.pgh.pa.us>
Re: array indizes in SQL "Rodrigo De León" <rdeleonp@gmail.com>
Re: array indizes in SQL Hans-Peter Oeri <hp@oeri.ch>
Re: array indizes in SQL "Rodrigo De León" <rdeleonp@gmail.com>
Re: array indizes in SQL Hans-Peter Oeri <hp@oeri.ch>
Re: array indizes in SQL "Rodrigo De León" <rdeleonp@gmail.com>
Hi!

Rodrigo De León wrote:
Is there a better way to "decompose" an array? (that I didn't find)   
SELECT a.attname AS "primarykey"
FROM pg_catalog.pg_attribute AS a,    pg_catalog.pg_constraint AS o
WHERE a.attnum = ANY (o.conkey)
AND   a.attrelid = o.conrelid
AND   o.contype = 'p'
AND   o.conrelid = CAST ( ? AS regclass)
ORDER BY a.attnum ASC 
Thanks for your input... However, you're ignoring the index field order - which might differ from attribute order. At least some querys need 'correct' index orders, like foreign key (field) relations: the field at index position 2 in table a relates to the field at index position 2 in table b.

HPO
В списке pgsql-novice по дате отправления
От: Rodrigo De León
Дата:
Сообщение: Re: array indizes in SQL
От: Rodrigo De León
Дата:
Сообщение: Re: array indizes in SQL
FAQ