Re: foreign keys for array/period contains relationships

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: foreign keys for array/period contains relationships
Дата
Msg-id AANLkTimcWAesj+cDh62qxXKuzrvA--+ULJa8i-kSr=Pn@mail.gmail.com
обсуждение исходный текст
Ответ на foreign keys for array/period contains relationships  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: foreign keys for array/period contains relationships  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
On Mon, Oct 25, 2010 at 3:11 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
> Currently, foreign keys only work with the = operator (the name might be
> different, but it needs to behave like equality).  I'm thinking there
> are other scenarios that could be useful, for example with arrays and
> range types.
>
> Example #1: Foreign key side is an array, every member must match some
> PK.
>
> CREATE TABLE pk (a int PRIMARKY KEY, ...);
>
> CREATE TABLE fk (x int[] REFERENCES pk (a), ...);

I've wished for this before when doing app dev with PG.  I think it
would be pretty neat.  The other cases seem potentially useful, too,
but especially this one.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: ask for review of MERGE
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: add label to enum syntax