From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: fredrik.widlert@digpro.se
Subject: BUG #15579: Adding a column with default from configuration parameter fails on 11.1
Date: Mon, 07 Jan 2019 12:14:17 +0000
Message-ID: <15579-c1494c68abb011ec@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 15579
Logged by: Fredrik Widlert
Email address: fredrik.widlert@digpro.se
PostgreSQL version: 11.1
Operating system: Ubuntu 18.04.1 LTS
Description:
We use configuration parameters as default values in some tables,
like this:
create table t (x int, str varchar(50) default
current_setting('public.some_setting'));
This works in version 11.1 as well as in earlier versions, since we
call set_config before inserting data into the table.
However, creating the table first and then adding the column does not
work on 11.1. It used to work at least from version 9.3 to 10.
create table t (x int);
alter table t add c varchar(50) default
current_setting('public.some_setting');
On 11.1 (Ubuntu 11.1-1.pgdg18.04+1 on x86_64-pc-linux-gnu), this fails
with
ERROR: unrecognized configuration parameter "public.some_setting"
unless we have called set_config in the session trying to add the column.
We expect to only have to call set_config in the session trying
to insert data into the table.
Is this a bug or pehaps an intended change? We tried googling but
didn't find anything which seemed relevant.
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: noreply@postgresql.org, fredrik.widlert@digpro.se
Subject: Re: BUG #15579: Adding a column with default from configuration parameter fails on 11.1
In-Reply-To: <15579-c1494c68abb011ec@postgresql.org>
References: <15579-c1494c68abb011ec@postgresql.org>
* 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