Re: 42P16 error when dropping and adding column - Mailing list pgsql-bugs

From Fujii Masao
Subject Re: 42P16 error when dropping and adding column
Date
Msg-id CAHGQGwGPJNq_p8w5W9jvA__6GOmFk5A0K7Vxw3ab0ASotvQy3g@mail.gmail.com
Whole thread
In response to Re: 42P16 error when dropping and adding column  (Manuel Reyes Bravo <manuelreyesbravo@gmail.com>)
Responses Re: 42P16 error when dropping and adding column
List pgsql-bugs
On Fri, Sep 18, 2026 at 12:01 AM Manuel Reyes Bravo
<manuelreyesbravo@gmail.com> wrote:
> v1's test covers the DROP COLUMN form only.  The attached top-up adds
> the three commands above to the same place in alter_table.sql.

Thanks! Attached is v2 patch, which includes your tests.

While working with the v1 patch, I found that the following DDL failed even
though it succeeds without the patch. v2 fixes this regression introduced by
v1.

CREATE TABLE t (id int NOT NULL);
ALTER TABLE t
  ALTER COLUMN id DROP NOT NULL,
  ADD PRIMARY KEY (id),
  ADD CONSTRAINT hoge NOT NULL id;

Regards,

--
Fujii Masao

Attachment

pgsql-bugs by date:

Previous
From: Trakshan Mishra
Date:
Subject: Re: BUG #19684: Assertion in tuplesort_begin_heap() falsified by parallel plan with sort
Next
From: Manu
Date:
Subject: Re: BUG #19705: One NaN box makes a BRIN box_inclusion_ops index omit unrelated rows