Thread: BUG #3396: strange error report for 'create domain ... default null'

BUG #3396: strange error report for 'create domain ... default null'

From
"Sergey Burladyan"
Date:
The following bug has been logged online:

Bug reference:      3396
Logged by:          Sergey Burladyan
Email address:      eshkinkot@gmail.com
PostgreSQL version: 8.1.9
Operating system:   CentOS release 5 (Final)
Description:        strange error report for 'create domain ... default
null'
Details:

i try create domain with 'default null' value, but postgres say:
ERROR:  cache lookup failed for type 0

without 'default null' it is work good.

seb=> select version();
                                                version
----------------------------------------------------------------------------
----------------------------
 PostgreSQL 8.1.9 on i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 4.1.1
20070105 (Red Hat 4.1.1-52)
(1 row)

Time: 1.160 ms
seb=> begin;
BEGIN
Time: 0.141 ms
seb=> CREATE DOMAIN qos_class_domain AS varchar(32) DEFAULT NULL CHECK
(VALUE IS NULL OR VALUE IN ('be', 'cir', 'cbr'));
ERROR:  XX000: cache lookup failed for type 0
LOCATION:  typeidTypeRelid, parse_type.c:347
seb=> ROLLBACK ;
ROLLBACK
Time: 0.098 ms
seb=>
"Sergey Burladyan" <eshkinkot@gmail.com> writes:
> i try create domain with 'default null' value, but postgres say:
> ERROR:  cache lookup failed for type 0

Hmm, looks like that's been broken since day one.  Fixed, thanks for the
report.

            regards, tom lane