pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marco Nenciarini <marco.nenciarini@devise.it>
To: Noah Misch <noah@leadboat.com>
Cc: Gabriele Bartolini <gabriele.bartolini@2ndQuadrant.it>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] Support for foreign keys with arrays
Date: Sat, 14 Jan 2012 20:09:33 +0100
Message-ID: <1326568173.2613.14.camel@greygoo.devise-it.lan> (raw)
In-Reply-To: <20111212004506.GB10399@tornado.leadboat.com>
References: <4EB3DF02.4020604@2ndQuadrant.it>
	<20111117042841.GA20517@tornado.leadboat.com>
	<4EC8CA0F.8040405@2ndQuadrant.it>
	<20111120130526.GD12013@tornado.leadboat.com>
	<4EE31CB9.90005@2ndQuadrant.it>
	<20111212004506.GB10399@tornado.leadboat.com>

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.nenciarini@devise.it | http://www.devise.it

Attachments:

  foreign-key-array-v2.patch.gz (application/x-gzip, 20.6K) download

view thread (62+ messages)  latest in thread

Message-ID: <1326568173.2613.14.camel@greygoo.devise-it.lan>
Permalink:  ../1326568173.2613.14.camel@greygoo.devise-it.lan/
Also on:    postgresql.org/message-id/1326568173.2613.14.camel@greygoo.devise-it.lan

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: marco.nenciarini@devise.it, noah@leadboat.com, gabriele.bartolini@2ndQuadrant.it
  Subject: Re: [PATCH] Support for foreign keys with arrays
  In-Reply-To: <1326568173.2613.14.camel@greygoo.devise-it.lan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox