The following bug has been logged online:

Bug reference:      3659
Logged by:          Michael Enke
Email address:      [EMAIL PROTECTED]
PostgreSQL version: 8.1.4
Operating system:   Linux, CentOS5
Description:        should use implizit type cast in check constraint
Details: 

Hello,
if I have defined my own data type/operators,
in a check constraint this type is used
instead of ::text.
Shouln't be there an implizit typecast to ::text?
Otherwise I always have to add an explicit typecast
if I have conflicting types/operators
but this would not be nice.

create table b(a varchar(1) check(a in ('1','2')));
\d b:
             Table "public.b"
 Column |         Type         | Modifiers
--------+----------------------+-----------
 a      | character varying(1) |
Check constraints:
    "b_a_check" CHECK (a = '1'::text OR a = '2'::text)

But if I have defined a type testchar and create this table again without an
explicit type cast:
\d b
             Table "public.b"
 Column |         Type         | Modifiers
--------+----------------------+-----------
 a      | character varying(1) |
Check constraints:
    "b_a_check" CHECK (a = '1'::testchar OR a = '2'::testchar)

I can send test case files if required.

Regards,
Michael

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to