Re: constrains of array - Mailing list pgsql-bugs

From Tom Lane
Subject Re: constrains of array
Date
Msg-id 2765.976647872@sss.pgh.pa.us
Whole thread Raw
In response to Re: constrains of array  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: constrains of array  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List 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

pgsql-bugs by date:

Previous
From: Merrill Oveson
Date:
Subject: case with distinct
Next
From: Tom Lane
Date:
Subject: Re: case with distinct