Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 105B54760CE for ; Wed, 23 Oct 2002 09:10:19 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id D0193475FD4 for ; Wed, 23 Oct 2002 09:10:14 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 439A8D60A; Wed, 23 Oct 2002 06:10:18 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 3954F5C02; Wed, 23 Oct 2002 06:10:18 -0700 (PDT) Date: Wed, 23 Oct 2002 06:10:18 -0700 (PDT) From: Stephan Szabo To: Gareth Kirwan Cc: Subject: Re: INT array field referencing same table In-Reply-To: Message-ID: <20021023060453.O3876-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/214 X-Sequence-Number: 6072 On Wed, 23 Oct 2002, Gareth Kirwan wrote: > Gareth StationeryFurther information: > > I've now tried this ( I would have tried it first but the server was having > it's nappy changed. > It seems to have a problem with the notion that the individual items of the > array are the references to the id, rather than the array itself. > How can I tell it this? > Am I missing something in the documentation that tells me how to do this? You can't tell it that. The types on both sides of a foreign key constraint need to be of comparable types (in this case defined as having an = operator). int[] and int aren't comparable. There's occasionally been talk about making type[]->type foreign keys use element in array rather than equality, but since type[] could be a multidimensional array I'm not sure that's well defined. > Raw Error: > ERROR: Unable to identify an operator '=' for types 'integer[]' and > 'integer' > You will have to retype this query using an explicit cast