Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 4DF2B5E060F for ; Tue, 31 Jan 2012 11:56:00 -0400 (AST) Received: from delta01.pnet.xcon.it ([62.48.53.16]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RsG3m-0003RF-F9 for pgsql-hackers@postgresql.org; Tue, 31 Jan 2012 15:55:59 +0000 Received: from localhost (localhost [127.0.0.1]) by delta01.pnet.xcon.it (Postfix) with ESMTP id A5ADA104073AC; Tue, 31 Jan 2012 16:55:41 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at delta01.pnet.xcon.it Received: from delta01.pnet.xcon.it ([127.0.0.1]) by localhost (delta01.pnet.xcon.it [127.0.0.1]) (amavisd-new, port 10024) with LMTP id XasutD6gQzaG; Tue, 31 Jan 2012 16:55:41 +0100 (CET) Received: from Gabriele.local (unknown [83.149.163.202]) (Authenticated sender: gabriele.bartolini@devise.it) by delta01.pnet.xcon.it (Postfix) with ESMTPSA id 55996104056C3; Tue, 31 Jan 2012 16:55:41 +0100 (CET) Message-ID: <4F280EFE.1080604@2ndQuadrant.it> Date: Tue, 31 Jan 2012 16:55:42 +0100 From: Gabriele Bartolini User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Noah Misch CC: Marco Nenciarini , PostgreSQL-development Subject: Re: [PATCH] Support for foreign keys with arrays 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> <1326568728.2613.16.camel@greygoo.devise-it.lan> <20120121204223.GA2388@tornado.leadboat.com> In-Reply-To: <20120121204223.GA2388@tornado.leadboat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201201/1738 X-Sequence-Number: 202325 Hi Noah, Il 21/01/12 21:42, Noah Misch ha scritto: > On Sat, Jan 14, 2012 at 08:18:48PM +0100, Marco Nenciarini wrote: > I greatly like that name; it would still make sense for other > aggregate types, should we ever expand its use. Please complete the > name change: the documentation, catalog entries, etc should all call > them something like "each foreign key constraints" (I don't > particularly like that exact wording). Ok, we'll go with "EACH Foreign Key Constraints" but I would allow the synonym "Foreign Key Array", especially in the documentation. > How about: FOREIGN KEY(col_a, EACH col_b, col_c) REFERENCES pktable > (a, b, c) We really like this syntax. However, as also Simon suggested, we'd go for switching to this syntax, but stick to a simpler implementation for 9.2. We will then be able to expand the functionality, by keeping the same syntax, from 9.3. > To complete the ARRAY -> EACH transition, I would suggest names like > CASCADE EACH/SET EACH NULL. Sounds perfect. Marco will go through all your comments and will send version 3 shortly. Thank you, Gabriele -- Gabriele Bartolini - 2ndQuadrant Italia PostgreSQL Training, Services and Support gabriele.bartolini@2ndQuadrant.it | www.2ndQuadrant.it