Re: [PATCH] Support for Array ELEMENT Foreign Keys

Поиск
Список
Период
Сортировка
От Claudio Freire
Тема Re: [PATCH] Support for Array ELEMENT Foreign Keys
Дата
Msg-id CAGTBQpYyu_m6X+Diy8TEtgjMJp_m_PAxaZKa2wcyyXNBpWY0sQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Support for Array ELEMENT Foreign Keys  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [PATCH] Support for Array ELEMENT Foreign Keys
Список pgsql-hackers
On Fri, Oct 19, 2012 at 5:48 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> It looks like we could support
>
>         CREATE TABLE t1 (c int[] REFERENCES BY ELEMENT t2);
>
> but (1) this doesn't seem terribly intelligible to me, and
> (2) I don't see how we modify that if we want to provide
> at-least-one-match semantics later.

What about something more generic?

CREATE TABLE <tname> ( <cname> <type> [(<expr>)] REFERENCES <t2name>
[(<t2expr>)] )

Meaning, if <expr> is missing, it's taken <expr> = <cname>, if not,
it's the result of that expression the one that references the target
table.

Sounds crazy, but with ALL() and ANY() it ought to support lots of subcases.



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: First draft of snapshot snapshot building design document
Следующее
От: Andres Freund
Дата:
Сообщение: Re: [PATCH] Support for Array ELEMENT Foreign Keys