From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Gareth Kirwan <gbjk@thermeoneurope.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: INT array field referencing same table
Date: Wed, 23 Oct 2002 06:10:18 -0700 (PDT)
Message-ID: <20021023060453.O3876-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <KMEELFAKJGHIGGNIDGHDEEADJPAA.gbjk@thermeoneurope.com>
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
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: sszabo@megazone23.bigpanda.com, gbjk@thermeoneurope.com
Subject: Re: INT array field referencing same table
In-Reply-To: <20021023060453.O3876-100000@megazone23.bigpanda.com>
References: <KMEELFAKJGHIGGNIDGHDEEADJPAA.gbjk@thermeoneurope.com> <20021023060453.O3876-100000@megazone23.bigpanda.com>
* 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