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

From: PG Doc comments form <noreply(at)postgresql(dot)org>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Cc: psy2000usa(at)yahoo(dot)com
Subject: further clarification: alter table alter column set not null - table scan is skipped
Date: 2025-07-30 04:52:16
Message-ID: 175385113607.786.16774570234342968908@wrigleys.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-docs

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

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Jeff Davis 2025-07-30 19:58:50 Re: Initcap works differently with different locale providers
Previous Message Oleg Tselebrovskiy 2025-07-29 04:03:33 Re: Initcap works differently with different locale providers