Re: INT array field referencing same table

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: INT array field referencing same table
Дата
Msg-id 20021023060453.O3876-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Re: INT array field referencing same table  ("Gareth Kirwan" <gbjk@thermeoneurope.com>)
Список pgsql-admin
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



В списке pgsql-admin по дате отправления:

Предыдущее
От: markus.cl@gmx.de (Markus Dehmann)
Дата:
Сообщение: Print line?
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: newbie psql - Backup/Restore - database