BUG #15579: Adding a column with default from configuration parameterfails on 11.1
| От | PG Bug reporting form |
|---|---|
| Тема | BUG #15579: Adding a column with default from configuration parameterfails on 11.1 |
| Дата | |
| Msg-id | 15579-c1494c68abb011ec@postgresql.org обсуждение исходный текст |
| Ответы |
Re: BUG #15579: Adding a column with default from configurationparameter fails on 11.1
Re: BUG #15579: Adding a column with default from configuration parameter fails on 11.1 Re: BUG #15579: Adding a column with default from configuration parameter fails on 11.1 |
| Список | pgsql-bugs |
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.
В списке pgsql-bugs по дате отправления: