pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: colin@darie.eu
Subject: BUG #16441: Cannot multi-insert into generated column with DEFAULT value
Date: Fri, 15 May 2020 21:07:33 +0000
Message-ID: <16441-f26a1a93b7a4bf7b@postgresql.org> (raw)

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.



view thread (2+ messages)  latest in thread

Message-ID: <16441-f26a1a93b7a4bf7b@postgresql.org>
Permalink:  ../16441-f26a1a93b7a4bf7b@postgresql.org/
Also on:    postgresql.org/message-id/16441-f26a1a93b7a4bf7b@postgresql.org

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, colin@darie.eu
  Subject: Re: BUG #16441: Cannot multi-insert into generated column with DEFAULT value
  In-Reply-To: <16441-f26a1a93b7a4bf7b@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