Re: Fast AT ADD COLUMN with DEFAULTs - Mailing list pgsql-hackers

From Vitaly Burovoy
Subject Re: Fast AT ADD COLUMN with DEFAULTs
Date
Msg-id CAKOSWN=QkE8Mza7LWpCXOTVwTiZWRRveL_On2BJTsfN23USzHg@mail.gmail.com
Whole thread Raw
In response to Re: Fast AT ADD COLUMN with DEFAULTs  (Andres Freund <andres@anarazel.de>)
Responses Re: Fast AT ADD COLUMN with DEFAULTs  (Andres Freund <andres@anarazel.de>)
Re: Fast AT ADD COLUMN with DEFAULTs  (Serge Rielau <serge@rielau.com>)
List pgsql-hackers
On 10/5/16, Andres Freund <andres@anarazel.de> wrote:
> On 2016-10-05 11:58:33 -0700, Serge Rielau wrote:
>> Dear Hackers,
>> I’m working on a patch that expands PG’s ability to add columns to a table
>> without a table rewrite (i.e. at O(1) cost) from the
>> nullable-without-default to a more general case.
>
> If I understand this proposal correctly, altering a column default will
> still have trigger a rewrite unless there's previous default?

No, "a second “exist default"" was mentioned, i.e. it is an additional
column in a system table (pg_attribute) as default column values of
the "pre-alter" era. It solves changing of the default expression of
the same column later.

--
Best regards,
Vitaly Burovoy



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Fast AT ADD COLUMN with DEFAULTs
Next
From: Andres Freund
Date:
Subject: Re: Fast AT ADD COLUMN with DEFAULTs