Re: constrains of array - Mailing list pgsql-bugs

From Stephan Szabo
Subject Re: constrains of array
Date
Msg-id Pine.BSF.4.21.0012121127270.32695-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: constrains of array  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: constrains of array  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Tue, 12 Dec 2000, Tom Lane wrote:

> 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.

The only case I could see would be if there was some case where you had
equality operators that needed to be defined after the table that had
the references constraint (not sure if that could ever happen).  You
could use alter table in these cases though.

> 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?
I think the spec only requires them to be comparable I believe (I'd
assume that the match predicate rules would apply), so would an equality
operator be sufficient to tell that?

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: case with distinct
Next
From: Bruce Momjian
Date:
Subject: Re: select cash_out('2'); crashes backend on 7.0.2