BUG #16441: Cannot multi-insert into generated column with DEFAULT value

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: colin(at)darie(dot)eu
Subject: BUG #16441: Cannot multi-insert into generated column with DEFAULT value
Date: 2020-05-15 21:07:33
Message-ID: 16441-f26a1a93b7a4bf7b@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16441
Logged by: Colin Darie
Email address: colin(at)darie(dot)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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2020-05-15 22:32:10 BUG #16442: terraform provider postgresql 9.0.0/9.4/12.3/current/latest fail
Previous Message Curt Kolovson 2020-05-15 18:47:32 Re: BUG #16440: pg_basebackup intermittently hangs waiting for input unless run with --checkpoint=fast option