Re: Insert/Dump/Restore table with generated columns

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: zickzack(at)quantentunnel(dot)de
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Insert/Dump/Restore table with generated columns
Date: 2021-07-08 14:12:04
Message-ID: 1959877.1625753524@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

zickzack(at)quantentunnel(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Wiwwo Staff 2021-07-08 15:15:35 Re: On partitioning, PKs and FKs
Previous Message zickzack 2021-07-08 14:01:25 Re: Re: Insert/Dump/Restore table with generated columns