pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: zickzack@quantentunnel.de
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Insert/Dump/Restore table with generated columns
Date: Thu, 08 Jul 2021 10:12:04 -0400
Message-ID: <1959877.1625753524@sss.pgh.pa.us> (raw)
In-Reply-To: <trinity-6620c869-da27-4cb7-b297-c4790eb2036c-1625752885239@3c-app-gmx-bs63>
References: <trinity-340020e9-5368-4228-8896-3a3efddead81-1625134007426@3c-app-gmx-bap01>
	<CAApHDvp_gDVwnZvh9dQDfOmsj2QOX+v4uMK-4MWH2kjYTR6ogg@mail.gmail.com>
	<trinity-6620c869-da27-4cb7-b297-c4790eb2036c-1625752885239@3c-app-gmx-bs63>

zickzack@quantentunnel.de writes:
> After you're answer I did a few investigations. If I insert data with a single insert, everything is working like expected
> INSERT INTO public.ab VALUES (1, DEFAULT);
> this changes if I do multiple inserts in one statement:
> INSERT INTO public.ab VALUES (1, DEFAULT), (2, DEFAULT);
> ERROR:  cannot insert into column "b"
> DETAIL:  Column "b" is a generated column.

> Is this a bug or a feature?

It's a deficiency :-(.  It's fixed for v14 but the fix seemed too invasive
to back-patch.

https://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=17958972f

			regards, tom lane





view thread (4+ messages)

Message-ID: <1959877.1625753524@sss.pgh.pa.us>
Permalink:  ../1959877.1625753524@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1959877.1625753524@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, zickzack@quantentunnel.de
  Subject: Re: Insert/Dump/Restore table with generated columns
  In-Reply-To: <1959877.1625753524@sss.pgh.pa.us>
  References: <trinity-340020e9-5368-4228-8896-3a3efddead81-1625134007426@3c-app-gmx-bap01> <CAApHDvp_gDVwnZvh9dQDfOmsj2QOX+v4uMK-4MWH2kjYTR6ogg@mail.gmail.com> <trinity-6620c869-da27-4cb7-b297-c4790eb2036c-1625752885239@3c-app-gmx-bs63> <1959877.1625753524@sss.pgh.pa.us>

* 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