From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: fredrik.widlert@digpro.se
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15579: Adding a column with default from configuration parameter fails on 11.1
Date: Mon, 7 Jan 2019 13:11:20 -0800
Message-ID: <20190107211120.6dztmhvm3hmmee4z@alap3.anarazel.de> (raw)
In-Reply-To: <4403.1546894903@sss.pgh.pa.us>
References: <15579-c1494c68abb011ec@postgresql.org>
<3336.1546873079@sss.pgh.pa.us>
<9c74611f-b373-3269-04b0-0803a217e1f1@dunslane.net>
<4403.1546894903@sss.pgh.pa.us>
On 2019-01-07 16:01:43 -0500, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
> > Stable expressions are quite ok for fast defaults. The expression is
> > evaluated once when the ALTER TABLE is done and the result (not the
> > expression) is stored in the catalog. The reason we check for volatile
> > expressions is precisely because we don't want all the existing rows to
> > get a single value in that case. This was discussed during the Postgres
> > 11 development cycle.
>
> Hmm.
>
> The issue here is that if the table is empty, the old behavior evaluated
> the expression zero times during ALTER TABLE. Now we evaluate it once,
> and if that throws an error, that's a user-visible behavior change.
>
> Perhaps it's okay to decide that that's an acceptable behavioral change,
> but it makes this feature less transparent than it was supposed to be.
It doesn't seem too hard to scan far enough to see whether there's a
single non-dead row. So we could fix this, if we wanted.
But I'm disinclined to think that it's worth doing so - and there could
be drawbacks, e.gg tables that are all-dead. Given the IMO quite minor
behaviour change, I'm thus disinclined to "fix" this..
Greetings,
Andres Freund
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: andres@anarazel.de, tgl@sss.pgh.pa.us, andrew@dunslane.net, fredrik.widlert@digpro.se
Subject: Re: BUG #15579: Adding a column with default from configuration parameter fails on 11.1
In-Reply-To: <20190107211120.6dztmhvm3hmmee4z@alap3.anarazel.de>
References: <15579-c1494c68abb011ec@postgresql.org> <3336.1546873079@sss.pgh.pa.us> <9c74611f-b373-3269-04b0-0803a217e1f1@dunslane.net> <4403.1546894903@sss.pgh.pa.us> <20190107211120.6dztmhvm3hmmee4z@alap3.anarazel.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox