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

From Andrew Dunstan
Subject Re: [PATCH] Support for Array ELEMENT Foreign Keys
Date
Msg-id 5081A566.7090002@dunslane.net
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 10/18/2012 10:26 PM, Tom Lane wrote:

> Another possibility is to forget about the column constraint ELEMENT
> REFERENCES syntax, and only support the table-constraint syntax with
> ELEMENT inside the column list --- I've not checked, but I think that
> syntax doesn't have any ambiguity problems.
>
> Or we could go back to using ARRAY here --- that should be safe since
> ARRAY is already fully reserved.
>
> Or we could choose some other syntax.  I'm wondering about dropping the
> use of a keyword entirely, and instead using '[]' decoration.  This
> wouldn't work too badly in the table constraint case:
>
>     FOREIGN KEY (foo, bar[]) REFERENCES t (x,y)
>
> but I'm less sure where to put the decoration for the column constraint
> case.
>
> Thoughts?
>
>             


I'm late to this party, so I apologize in advance if this has already 
been considered, but do we actually need a special syntax? Can't we just 
infer that we have one of these when the referring column is an array 
and the referenced column is of the base type of the array?

cheers

andrew





pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: assertion failure w/extended query protocol
Next
From: Andres Freund
Date:
Subject: Re: assertion failure w/extended query protocol