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 CAKOSWNmULzfZU3oEyZ2vxZts1NqqThhdsX+O7OgEzA8tML9ryA@mail.gmail.com
Whole thread Raw
In response to Re: Fast AT ADD COLUMN with DEFAULTs  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 10/6/16, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Serge Rielau <serge@rielau.com> writes:
>>> On Oct 6, 2016, at 5:25 AM, Vitaly Burovoy <vitaly.burovoy@gmail.com>
>>> wrote:
>>>> Which makes me think we should call this missing_value or absent_value

Be honest Simon Rigg's wrote that words.

>>>> so its clear that it is not a "default" it is the value we use for
>>>> rows that do not have any value stored for them.
>
>> I like Tom’s “creation default”. Another one could be “initial default”.
>> But that, too, can be misread.
>
> Something based on missing_value/absent_value could work for me too.
>
> If we name it something involving "default", that definitely increases
> the possibility for confusion with the regular user-settable default.
>
> Also worth thinking about here is that the regular default expression
> affects what will be put into future inserted rows, whereas this thing
> affects the interpretation of past rows.  So it's really quite a different
> animal.  That's kind of leading me away from calling it creation_default.
>
> BTW, it also occurs to me that there are going to be good implementation
> reasons for restricting it to be a hard constant, not any sort of
> expression.  We are likely to need to be able to insert the value in
> low-level code where general expression evaluation is impractical.

Yes, I mentioned that it should be evaluated and stored as a value
because user functions can be changed (besides the speed reason),
that's why I like the "value" in its name. The "default" is usually
identified with expressions, not values (which are particular cases of
expressions).

Serge mentioned the phrase "pre-existing rows", which makes me think
about something like "pre_existing_value"....

--
Best regards,
Vitaly Burovoy



pgsql-hackers by date:

Previous
From: Serge Rielau
Date:
Subject: Re: Fast AT ADD COLUMN with DEFAULTs
Next
From: Tom Lane
Date:
Subject: Re: Fast AT ADD COLUMN with DEFAULTs