Skip site navigation (1) Skip section navigation (2)

Re: [PATCH] Support for foreign keys with arrays

From: Marco Nenciarini <marco(dot)nenciarini(at)devise(dot)it>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Gabriele Bartolini <gabriele(dot)bartolini(at)2ndQuadrant(dot)it>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Support for foreign keys with arrays
Date: 2012-01-14 19:09:33
Message-ID: 1326568173.2613.14.camel@greygoo.devise-it.lan (view raw or flat)
Thread:
Lists: pgsql-hackers
Hello,

Il giorno dom, 11/12/2011 alle 19.45 -0500, Noah Misch ha scritto:
> On Sat, Dec 10, 2011 at 09:47:53AM +0100, Gabriele Bartolini wrote:
> > So, here is a summary:
> >
> > --------------- --------- ---------
> >                |   ON    |   ON    |
> > Action         | DELETE  | UPDATE  |
> > --------------- --------- ---------
> > CASCADE        |   Row   |  Error  |
> > SET NULL       |   Row   |   Row   |
> > SET DEFAULT    |   Row   |   Row   |
> > ARRAY CASCADE  | Element | Element |
> > ARRAY SET NULL | Element | Element |
> > NO ACTION      |    -    |    -    |
> > RESTRICT       |    -    |    -    |
> > --------------- --------- ---------
> >
> > If that's fine with you guys, Marco and I will refactor the development  
> > based on these assumptions.
> 
> Looks fine.
> 

This is our latest version of the patch. Gabriele, Gianni and I have
discussed a lot and decided to send an initial patch which uses EACH
REFERENCES instead of ARRAY REFERENCES. The reason behind this is that
ARRAY REFERENCES generates an ambiguous grammar, and we all agreed that
EACH REFERENCES makes sense (and the same time does not introduce any
new keyword). This is however open for discussion.


The patch now includes the following clauses on the delete/update
actions - as per previous emails:


--------------- --------- ---------
               |   ON    |   ON    |
Action         | DELETE  | UPDATE  |
--------------- --------- ---------
CASCADE        |   Row   |  Error  |
SET NULL       |   Row   |   Row   |
SET DEFAULT    |   Row   |   Row   |
ARRAY CASCADE  | Element | Element |
ARRAY SET NULL | Element | Element |
NO ACTION      |    -    |    -    |
RESTRICT       |    -    |    -    |
--------------- --------- --------- 


We will resubmit the patch for the 2012-01 commit fest.


Thank you,
Marco


-- 
Marco Nenciarini - System manager @ Devise.IT
marco(dot)nenciarini(at)devise(dot)it | http://www.devise.it


Attachment: foreign-key-array-v2.patch.gz
Description: application/x-gzip (20.6 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Marco NenciariniDate: 2012-01-14 19:18:48
Subject: Re: [PATCH] Support for foreign keys with arrays
Previous:From: Kevin GrittnerDate: 2012-01-14 18:39:34
Subject: Re: Remembering bug #6123

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group