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

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Gus Spier <gus(dot)spier(at)gmail(dot)com>
Cc: Alexander Kukushkin <cyberdemn(at)gmail(dot)com>, pgsql-general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is there any technical reason why "alter table .. set not null" can't use index?
Date: 2021-09-10 17:55:52
Message-ID: 20210910175552.GA7127@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Keith Christian 2021-09-11 00:08:04 PostgreSQL starting with a corrupted database or other fatal issues
Previous Message Gus Spier 2021-09-10 17:26:46 Re: Is there any technical reason why "alter table .. set not null" can't use index?