constrains of array

From: Alexander Klimov <ask(at)wisdom(dot)weizmann(dot)ac(dot)il>
To: pgsql-bugs(at)postgresql(dot)org
Subject: constrains of array
Date: 2000-12-07 10:42:16
Message-ID: Pine.SUN.4.21.0012071223060.12201-100000@dardar.wisdom.weizmann.ac.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi.

I use version from cvs.

I want to have array of referencies to another table, so I do:
cms=# create table a (a int primary key); create table b (b int[]
references a);
NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'a_pkey' for
table 'a'
CREATE
NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY
check(s)
CREATE

But now I can't add anything to table b:
cms=# insert into a values (1);
INSERT 52069 1
cms=# insert into b values ('{1}');
ERROR: Unable to identify an operator '=' for types 'int4' and '_int4'
You will have to retype this query using an explicit cast

I expect either of following:
1) REFERENCIES from array to scalar should create correct trigger (check
every entity of array)
or
2) It should be error in *creation* of table if there is no comparasion
operator for constrain check
or
3) Error in insert should say something about trigger, otherwise user have
to guess what is wrong with his query.

Regards,
ASK

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Ricardo Dias Marques 2000-12-07 13:07:17 pg_dump backup problems with password authentication
Previous Message Mark Stosberg 2000-12-06 20:06:07 select cash_out('2'); crashes backend on 7.0.2