how to determine array size

Поиск
Список
Период
Сортировка
От Forest Wilkinson
Тема how to determine array size
Дата
Msg-id nqh9ev007tlivjj1nnakco0ci541jucse5@4ax.com
обсуждение исходный текст
Ответы Re: how to determine array size  (Achilleus Mantzios <achill@matrix.gatewaynet.com>)
Re: how to determine array size  (Rod Taylor <rbt@rbt.ca>)
Список pgsql-sql
I need to enumerate the constraints on any given column in a table, so
I'm examining pg_constraint to get the relevant information.  The
conkey array contains a list of constrained columns, and although I am
able to check conkey[1] for constraints on a single column, I would
like to properly handle multi-column constraints.

How do I determine the size of the conkey array?  I haven't found any
field that looks like it contains the number of values in conkey.  Do
I have to check each element of the array sequentially, until I get a
NULL value from one of them?  (Section 5.12 of the User's Guide seems
to forbid this: "A limitation of the present array implementation is
that individual elements of an array cannot be SQL null values.")
Moreover, that method doesn't give me a nice way of selecting all
constraints on a specific column, as I would have to write clauses
like this:

... WHERE conkey[1] = blah OR conkey[2] = blah OR conkey[3] = blah OR
conkey[4] = blah ...

Can somone offer a better way?



В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Column limits in table/ views
Следующее
От: Michael A Nachbaur
Дата:
Сообщение: Re: "Join" on delimeter aggregate query