From: hubert depesz lubaczewski <depesz@depesz.com>
To: Gus Spier <gus.spier@gmail.com>
Cc: Alexander Kukushkin <cyberdemn@gmail.com>
Cc: pgsql-general mailing list <pgsql-general@postgresql.org>
Subject: Re: Is there any technical reason why "alter table .. set not null" can't use index?
Date: Fri, 10 Sep 2021 19:55:52 +0200
Message-ID: <20210910175552.GA7127@depesz.com> (raw)
In-Reply-To: <7E44EA26-9343-444F-B01C-30944AB8C60A@gmail.com>
References: <20210908051453.GB20274@depesz.com>
<7E44EA26-9343-444F-B01C-30944AB8C60A@gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: depesz@depesz.com, gus.spier@gmail.com, cyberdemn@gmail.com
Subject: Re: Is there any technical reason why "alter table .. set not null" can't use index?
In-Reply-To: <20210910175552.GA7127@depesz.com>
References: <20210908051453.GB20274@depesz.com> <7E44EA26-9343-444F-B01C-30944AB8C60A@gmail.com> <20210910175552.GA7127@depesz.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox