PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID15579
PG Version11.1
OSUbuntu 18.04.1 LTS
Opened2019-01-07 12:14:17+00
Reported byFredrik Widlert
StatusOpen

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      15579
Logged by:          Fredrik Widlert
Email address:      (redacted)
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.

Messages

DateAuthorSubject
2019-01-07 12:14:17+00=?utf-8?q?PG_Bug_reporting_form?=BUG #15579: Adding a column with default from configuration parameter fails on 11.1
2019-01-07 13:28:25+00Dmitry DolgovRe: BUG #15579: Adding a column with default from configuration parameter fails on 11.1
2019-01-07 14:57:59+00Tom LaneRe: BUG #15579: Adding a column with default from configuration parameter fails on 11.1
2019-01-07 17:36:13+00Andrew DunstanRe: BUG #15579: Adding a column with default from configuration parameter fails on 11.1
2019-01-07 19:53:21+00Andrew GierthRe: BUG #15579: Adding a column with default from configuration parameter fails on 11.1
2019-01-07 21:01:43+00Tom LaneRe: BUG #15579: Adding a column with default from configuration parameter fails on 11.1
2019-01-07 21:11:20+00Andres FreundRe: BUG #15579: Adding a column with default from configuration parameter fails on 11.1
2019-01-07 21:22:31+00Andrew DunstanRe: BUG #15579: Adding a column with default from configuration parameter fails on 11.1