Re: Document atthasmissing default optimization avoids verification table scan

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: James Coleman <jtc331(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Document atthasmissing default optimization avoids verification table scan
Date: 2022-03-26 23:26:19
Message-ID: CAKFQuwYGnR+5se_9GxDeoryrLLQUQGXh7pqzAktu84P=xVmrAg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Mar 26, 2022 at 4:14 PM David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

>
> I would suggest rewriting 0001 to target ALTER COLUMN instead of in the
> generic notes section (in the paragraph beginning "Adding a column with a
> volatile DEFAULT") for the desired clarification.
>
>
Or, we can leave it where things are and make sure the reader understands
there are two paths to having a NOT NULL constraint on the newly added
column. Something like:

"If you plan on having a NOT NULL constraint on the newly added column you
should add it as a column constraint during the ADD COLUMN command. If you
add it later via ALTER COLUMN SET NOT NULL the table will have to be
completely scanned in order to ensure that no null values were inserted."

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-03-26 23:28:07 Re: pgsql: Add 'basebackup_to_shell' contrib module.
Previous Message Daniel Gustafsson 2022-03-26 23:20:44 Re: Small TAP tests cleanup for Windows and unused modules