From: | Claudio Freire <klaussfreire(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Marco Nenciarini <marco(dot)nenciarini(at)2ndquadrant(dot)it>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: [PATCH] Support for Array ELEMENT Foreign Keys |
Date: | 2012-10-19 20:55:50 |
Message-ID: | CAGTBQpYyu_m6X+Diy8TEtgjMJp_m_PAxaZKa2wcyyXNBpWY0sQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Fri, Oct 19, 2012 at 5:48 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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.
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2012-10-19 20:56:22 | Re: [PATCH] Support for Array ELEMENT Foreign Keys |
Previous Message | Peter Geoghegan | 2012-10-19 20:53:06 | Re: First draft of snapshot snapshot building design document |