Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 91E3EDF4DB6 for ; Fri, 25 Nov 2011 00:53:02 -0400 (AST) Received: from mailout-de.gmx.net ([213.165.64.22]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1RTnmW-00062y-RS for pgsql-hackers@postgresql.org; Fri, 25 Nov 2011 04:53:01 +0000 Received: (qmail invoked by alias); 25 Nov 2011 04:52:47 -0000 Received: from a88-115-218-165.elisa-laajakaista.fi (EHLO [10.0.0.102]) [88.115.218.165] by mail.gmx.net (mp036) with SMTP; 25 Nov 2011 05:52:47 +0100 X-Authenticated: #495269 X-Provags-ID: V01U2FsdGVkX19ymFwqyuxyLGJGvAvoTlQs81suTtsRWzC9TH9KlH 4vFFjuudc7VIep Message-ID: <1322196765.23871.5.camel@vanquo.pezone.net> Subject: Re: [PATCH] Support for foreign keys with arrays From: Peter Eisentraut To: Merlin Moncure Cc: Gabriele Bartolini , PostgreSQL-development , Marco Nenciarini Date: Fri, 25 Nov 2011 06:52:45 +0200 In-Reply-To: References: <4EB3DF02.4020604@2ndQuadrant.it> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.0.3-2 Content-Transfer-Encoding: 8bit Mime-Version: 1.0 X-Y-GMX-Trusted: 0 X-Archive-Number: 201111/1459 X-Sequence-Number: 198944 On mån, 2011-11-21 at 10:30 -0600, Merlin Moncure wrote: > I like the idea of being able to define more flexible foreign keys, > but are we gilding the lily here? The proposed solution is really > quite specific to the nuances of arrays. Perhaps there is a more > general expression based syntax that leaves the door open for other > types conditions such as dealing fields dependent on other fields? Yeah, basically you'd just need a contains and/or is-contained-by operator between the two types.