Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id A4D434248 for ; Thu, 22 Mar 2012 16:03:04 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SAnHp-0007fq-Ub for pgsql-hackers@postgresql.org; Thu, 22 Mar 2012 19:03:03 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q2MJ2jsX012610; Thu, 22 Mar 2012 15:02:45 -0400 (EDT) To: Marco Nenciarini cc: pgsql-hackers@postgresql.org, Noah Misch Subject: Re: [PATCH] Support for foreign keys with arrays In-reply-to: <1332178899.2278.4.camel@greygoo.devise-it.lan> References: <4EC8CA0F.8040405@2ndQuadrant.it> <20111120130526.GD12013@tornado.leadboat.com> <4EE31CB9.90005@2ndQuadrant.it> <20111212004506.GB10399@tornado.leadboat.com> <1326568728.2613.16.camel@greygoo.devise-it.lan> <20120121204223.GA2388@tornado.leadboat.com> <4F280EFE.1080604@2ndQuadrant.it> <1328551482.3354.64.camel@greygoo.devise-it.lan> <20120225020135.GA27204@tornado.leadboat.com> <1331748188.6744.15.camel@greygoo.devise-it.lan> <20120317033312.GB19556@tornado.leadboat.com> <1332178899.2278.4.camel@greygoo.devise-it.lan> Comments: In-reply-to Marco Nenciarini message dated "Mon, 19 Mar 2012 18:41:39 +0100" Date: Thu, 22 Mar 2012 15:02:45 -0400 Message-ID: <12609.1332442965@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201203/1420 X-Sequence-Number: 205302 Marco Nenciarini writes: > Attached is v5, which should address all the remaining issues. I started to look at this patch a bit. I'm quite confused by the fact that some, but not all, of the possible FK action types now come in an EACH variant. This makes no sense at all to me. ISTM that EACH is a property of the FK constraint as a whole, that is that it says the constraint is from array elements on the referencing side to column values on the referenced side, rather than the normal case of column values to column values. Why would the possible actions be affected, and why only these? The patch documentation is extremely unclear about this. It's even less clear about what the semantics are in multi-key cases. Right offhand I would say that multi-key cases are nonsensical and should be forbidden outright, because there is no way to figure out which collections of elements of different arrays should be considered to be a referencing item. Could we see a specification of what the referencing semantics are intended to be, please? regards, tom lane