Re: constrains of array

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: Alexander Klimov <ask@wisdom.weizmann.ac.il>, pgsql-bugs@postgresql.org
Date: 2000-12-12T19:04:32Z
Lists: pgsql-bugs
Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
>> 2) It should be error in *creation* of table if there is no comparasion
>> operator for constrain check

> Possibly, although it currently doesn't to allow you to add the operator
> after you do the references.  The benefits of that might be outweighed by
> the problems if you don't add the operator.

I can't see any good reason not to require the operator to pre-exist.
In fact, there's a good argument that we should require the two columns
to have the exact same datatype.  Otherwise, equality may be a pretty
fuzzy concept.  Think about varchar vs bpchar comparison, for example
--- shall we consider trailing blanks significant?  Which column will
drive the choice?

In any case, it's certainly a bad idea that the system accepted an
FK constraint relating int[] to int.

			regards, tom lane