Re: limitations of constraints, possible bugs

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: limitations of constraints, possible bugs
Дата
Msg-id 13898.1155737480@sss.pgh.pa.us
обсуждение исходный текст
Ответ на limitations of constraints, possible bugs  (craigp <craigp98072@yahoo.com>)
Ответы Re: limitations of constraints, possible bugs
Список pgsql-general
craigp <craigp98072@yahoo.com> writes:
> for instance, if i create a domain (D) with some constraint, and create a table
> with a column of type D[], will that domain constraint be enforced for each
> element of the array?

Currently we don't support arrays of domain types (this should get fixed
sometime).  If we did, then yeah, that's how it'd work.

> could i create a column constraint on an array to enforce
> some kind of relationship among the elements (say, that they are sorted, or
> that there are no NULL elements if/when NULL elements are supported in arrays),

If you could express it as a SQL boolean expression, then it'd work as a
constraint.  For something like a sortedness check, it'd likely be
easier to check with a loop in a trigger function.

> i have noticed in the docs that there are various limitations in the current
> implementation: domain constraints aren't enforced when returned from
> functions, rowtype (from create table) constraints aren't enforced, constraints
> can't be defined for composite types, etc. i see the first one is on the TODO
> list; what about the others?

The first of these is done in CVS HEAD, the others probably will get
done someday.  If you want to see them happen sooner rather than later,
consider working on 'em yourself ...

            regards, tom lane

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

Предыдущее
От: "Harald Armin Massa"
Дата:
Сообщение: Re: Is it possible (postgresql/mysql)
Следующее
От: Peter Nixonn
Дата:
Сообщение: Weird join result