Re: Re: Insert/Dump/Restore table with generated columns

Поиск
Список
Период
Сортировка
От zickzack@quantentunnel.de
Тема Re: Re: Insert/Dump/Restore table with generated columns
Дата
Msg-id trinity-6620c869-da27-4cb7-b297-c4790eb2036c-1625752885239@3c-app-gmx-bs63
обсуждение исходный текст
Ответ на Re: Insert/Dump/Restore table with generated columns  (David Rowley <dgrowleyml@gmail.com>)
Ответы Re: Insert/Dump/Restore table with generated columns  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi David,

thanks for you're quick answer.
I'am using postgres 12 and also tested with 13. Both inside the official (debian based) docker hub hosted container.

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?

In my specific backup case I exported the data with the flags: --column-inserts, --inserts and --rows-per-insert=1000.
Dueto the latter I ran into the behaviour described obove.
 
If I export the data with the default copy statement, no problems occur.

Greetings



В списке pgsql-general по дате отправления:

Предыдущее
От: Michael Lewis
Дата:
Сообщение: Re: optimization issue
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Insert/Dump/Restore table with generated columns