pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: colin@darie.eu
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16441: Cannot multi-insert into generated column with DEFAULT value
Date: Mon, 18 May 2020 16:57:26 +0200
Message-ID: <3a66b26f-0154-3216-1ed5-a63bf63ec61a@2ndquadrant.com> (raw)
In-Reply-To: <16441-f26a1a93b7a4bf7b@postgresql.org>
References: <16441-f26a1a93b7a4bf7b@postgresql.org>

On 2020-05-15 23:07, PG Bug reporting form wrote:
> 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.

Yes, this has been reported before.  This is basically just not 
implemented.  Is there a reason you need to use this form, or are you 
just trying things out?

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (2+ messages)

Message-ID: <3a66b26f-0154-3216-1ed5-a63bf63ec61a@2ndquadrant.com>
Permalink:  ../3a66b26f-0154-3216-1ed5-a63bf63ec61a@2ndquadrant.com/
Also on:    postgresql.org/message-id/3a66b26f-0154-3216-1ed5-a63bf63ec61a@2ndquadrant.com

 · 

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: peter.eisentraut@2ndquadrant.com, colin@darie.eu, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #16441: Cannot multi-insert into generated column with DEFAULT value
  In-Reply-To: <3a66b26f-0154-3216-1ed5-a63bf63ec61a@2ndquadrant.com>

* 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