Re: Is there any technical reason why "alter table .. set not null" can't use index? - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: Is there any technical reason why "alter table .. set not null" can't use index?
Date
Msg-id 20210910175552.GA7127@depesz.com
Whole thread Raw
In response to Re: Is there any technical reason why "alter table .. set not null" can't use index?  (Gus Spier <gus.spier@gmail.com>)
List pgsql-general
On Fri, Sep 10, 2021 at 01:26:46PM -0400, Gus Spier wrote:
> Would it help to create a new not null column in the target table, and
> then update the table by copying values from old column to the new,
> not null column? Of course you’d have to ignore errors, etc. but
> wouldn’t that perform at enough for your needs?

Why would you think that adding new column, with constraint, and copying
data would be faster?

depesz



pgsql-general by date:

Previous
From: Gus Spier
Date:
Subject: Re: Is there any technical reason why "alter table .. set not null" can't use index?
Next
From: Keith Christian
Date:
Subject: PostgreSQL starting with a corrupted database or other fatal issues