pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: 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, 07 Jan 2019 16:01:43 -0500
Message-ID: <4403.1546894903@sss.pgh.pa.us> (raw)
In-Reply-To: <9c74611f-b373-3269-04b0-0803a217e1f1@dunslane.net>
References: <15579-c1494c68abb011ec@postgresql.org>
	<3336.1546873079@sss.pgh.pa.us>
	<9c74611f-b373-3269-04b0-0803a217e1f1@dunslane.net>

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.

			regards, tom lane




view thread (8+ messages)  latest in thread

Message-ID: <4403.1546894903@sss.pgh.pa.us>
Permalink:  ../4403.1546894903@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4403.1546894903@sss.pgh.pa.us

 · 

reply

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: 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: <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>

* 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