BUG #16441: Cannot multi-insert into generated column with DEFAULT value - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #16441: Cannot multi-insert into generated column with DEFAULT value
Date
Msg-id 16441-f26a1a93b7a4bf7b@postgresql.org
Whole thread Raw
Responses Re: BUG #16441: Cannot multi-insert into generated column withDEFAULT value  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      16441
Logged by:          Colin Darie
Email address:      colin@darie.eu
PostgreSQL version: 12.3
Operating system:   macos
Description:

Multiple inserts of DEFAULT value for generated columns are failing. Single
inserts are OK.


CREATE TABLE squares (num INTEGER NOT NULL, square INTEGER GENERATED ALWAYS
AS (num * num) STORED);


INSERT INTO squares(num, square) VALUES (1, DEFAULT);
=> INSERT 0 1
INSERT INTO squares(num, square) VALUES (2, DEFAULT), (3, DEFAULT);
=> ERROR:  cannot insert into column "square"
=> DETAIL:  Column "square" is a generated column.


Tested with postgresql 12.2 and 12.3 on macos.


pgsql-bugs by date:

Previous
From: Curt Kolovson
Date:
Subject: Re: BUG #16440: pg_basebackup intermittently hangs waiting for inputunless run with --checkpoint=fast option
Next
From: PG Bug reporting form
Date:
Subject: BUG #16442: terraform provider postgresql 9.0.0/9.4/12.3/current/latest fail