Re: [PATCH] Support for Array ELEMENT Foreign Keys

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrew Dunstan <andrew@dunslane.net>, Marco Nenciarini <marco.nenciarini@2ndquadrant.it>, pgsql-hackers@postgresql.org
Date: 2012-10-19T20:21:46Z
Lists: pgsql-hackers
On Fri, Oct 19, 2012 at 3:55 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> That doesn't get us any closer to having a working column-constraint
> syntax unfortunately, because EACH is not a reserved word either
> so "EACH ELEMENT REFERENCES" still isn't gonna work.  I'm getting
> more willing to give up on having a column-constraint form of this.

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 ...

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