BUG #3659: should use implizit type cast in check constraint

Поиск
Список
Период
Сортировка
От Michael Enke
Тема BUG #3659: should use implizit type cast in check constraint
Дата
Msg-id 200710081504.l98F4aSP059656@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #3659: should use implizit type cast in check constraint
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      3659
Logged by:          Michael Enke
Email address:      michael.enke@wincor-nixdorf.com
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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Alessandra Bilardi"
Дата:
Сообщение: BUG #3658: I've got disk-full errors when insert relational tables.
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: BUG #3657: Performance leaks when using between of two equal dates