Re: BUG #3659: should use implizit type cast in check constraint - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #3659: should use implizit type cast in check constraint
Date
Msg-id 21019.1191859060@sss.pgh.pa.us
Whole thread Raw
In response to BUG #3659: should use implizit type cast in check constraint  ("Michael Enke" <michael.enke@wincor-nixdorf.com>)
List pgsql-bugs
"Michael Enke" <michael.enke@wincor-nixdorf.com> writes:
> if I have defined my own data type/operators,
> in a check constraint this type is used
> instead of ::text.

It looks to me like you must have defined an operator =(varchar,testchar)
--- the only way a user-defined type would win over text is to have an
exact match.  This is not a good idea.  Just define =(text,testchar)
and leave it to the implicit coercion code to handle varchar.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: BUG #3657: Performance leaks when using between of two equal dates
Next
From: Bruce Momjian
Date:
Subject: Re: BUG #3619: Renaming sequence does not update its 'sequence_name' field