Re: [PATCH] Support for Array ELEMENT Foreign Keys - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] Support for Array ELEMENT Foreign Keys
Date
Msg-id 8780.1350679721@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH] Support for Array ELEMENT Foreign Keys  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [PATCH] Support for Array ELEMENT Foreign Keys
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> This is a little sneaky, but I presume you only get the grammar
> conflict if you try to sneak the "each" or "element" or "each element"
> or whatever-you-call-it designator in BEFORE the column name.  So what
> about just putting it afterwards?  Something like this:

> FOREIGN KEY (a, b BY ELEMENT) REFERENCES ...

That's not the syntax we're having problems with, it's the column
constraint syntax; that is
CREATE TABLE t1 (c int[] REFERENCES t2);

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.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCH] Support for Array ELEMENT Foreign Keys
Next
From: Peter Geoghegan
Date:
Subject: Re: First draft of snapshot snapshot building design document