Attribute has wrong type in ALTER TABLE - Mailing list pgsql-bugs

From Manuel Rigger
Subject Attribute has wrong type in ALTER TABLE
Date
Msg-id CA+u7OA6RmQLwvXGxx0nGt3T79Ka5MkOJs4_qcdx6X5c-rR_yNg@mail.gmail.com
Whole thread Raw
Responses Re: Attribute has wrong type in ALTER TABLE  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Hi everyone,

the statements below result in an error "ERROR:  attribute 1 of type
t0 has wrong type":

CREATE TABLE t0(c0 VARCHAR(10));
INSERT INTO t0(c0) VALUES('');
ALTER TABLE t0 ALTER c0 SET DATA TYPE TEXT, ADD EXCLUDE (('a' LIKE
t0.c0) WITH =); -- unexpected: ERROR:  attribute 1 of type t0 has
wrong type

This is unexpected, since breaking up the ALTER TABLE actions does not
result in this error:

CREATE TABLE t0(c0 VARCHAR(10));
INSERT INTO t0(c0) VALUES('');
ALTER TABLE t0 ALTER c0 SET DATA TYPE TEXT;
ALTER TABLE t0 ADD EXCLUDE (('a' LIKE t0.c0) WITH =); -- no error

Best,
Manuel



pgsql-bugs by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: partition table slow planning
Next
From: Manuel Rigger
Date:
Subject: Re: ANALYZE on parent table results in an error "tuple alreadyupdated by self"