Re: further clarification: alter table alter column set not null - table scan is skipped

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: psy2000usa(at)yahoo(dot)com, PostgreSQL Documentation <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: further clarification: alter table alter column set not null - table scan is skipped
Date: 2025-07-30 21:46:57
Message-ID: CAKFQuwbkV4yQU_5rHWwCfwSY3mjhh_jk50THwYEdRvwAZ36BRQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Wed, Jul 30, 2025, 13:55 PG Doc comments form <noreply(at)postgresql(dot)org>
wrote:

> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/17/docguide.html
> Description:
>
> Hello there,
> I like PostgreSQL a lot so this is my way of giving back.
>
> The "table scan is skipped" optimization can use some clarification
>
> https://www.postgresql.org/docs/current/sql-altertable.html#SQL-ALTERTABLE-DESC-SET-DROP-NOT-NULL
> My proposal is "then the table scan is skipped if the alter statement
> doesn't drop the constraint."
>
> The reason behind the proposal is documented here
> https://dev.to/andrewpsy/the-set-not-null-downtime-trap-in-postgresql-1o71
>
> Thank you for working on such an awesome project.
> Cheers,
> Andrew
>

I'm kinda hoping this is actually just a fixable bug...

Otherwise I'd probably go for a parenthetical:
(however, the constraint used must not be dropped in the same alter table
command).

David J.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message David G. Johnston 2025-07-31 02:17:26 Lets prohibit predicting the future in the documentation.
Previous Message Jeff Davis 2025-07-30 19:58:50 Re: Initcap works differently with different locale providers