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

From Robert Haas
Subject Re: [PATCH] Support for Array ELEMENT Foreign Keys
Date
Msg-id CA+TgmobvB6dyKq1zRE7PKabe90J14=qxQV1H+GpMeBOpG5gKKg@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Support for Array ELEMENT Foreign Keys  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCH] Support for Array ELEMENT Foreign Keys  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Oct 22, 2012 at 12:08 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I wrote:
>> I tested, and indeed this seems to work:
>>       CREATE TABLE t1 (c int[] WHERE EACH ELEMENT REFERENCES t2);
>> and it's perfectly sensible from an English-grammar standpoint too.
>> If we take that, how would we spell the table-constraint case exactly?
>> Grammatically I'd prefer
>>       FOREIGN KEY (foo, EACH ELEMENT OF bar) REFERENCES
>
> Are people happy with these syntax proposals, or do we need some other
> color for the bikeshed?

Well, I can't say I'm very happy with the discrepancy between the two
syntaxes, but I guess I'm in the minority.  Still, I can't help but
think it's going to be confusing and hard to remember.  If we don't
get complaints about it, I'll take that as evidence that the feature
isn't being used, rather than evidence that the syntax is
satisfactory.

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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Successor of MD5 authentication, let's use SCRAM
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] Support for Array ELEMENT Foreign Keys