Attribute has wrong type in ALTER TABLE

From: Manuel Rigger <rigger(dot)manuel(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Attribute has wrong type in ALTER TABLE
Date: 2019-07-24 07:16:32
Message-ID: CA+u7OA6RmQLwvXGxx0nGt3T79Ka5MkOJs4_qcdx6X5c-rR_yNg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Manuel Rigger 2019-07-24 07:17:36 Re: ANALYZE on parent table results in an error "tuple already updated by self"
Previous Message Dilip Kumar 2019-07-24 05:35:03 Re: partition table slow planning