postgresql/src
Tom Lane aedc4600d8 Fix pg_dump --inserts mode for generated columns with dropped columns.
If a table contains a generated column that's preceded by a dropped
column, dumpTableData_insert failed to account for the dropped
column, and would emit DEFAULT placeholder(s) in the wrong column(s).
This resulted in failures at restore time.  The default COPY code path
did not have this bug, likely explaining why it wasn't noticed sooner.

While we're fixing this, we can be a little smarter about the
situation: (1) avoid unnecessarily fetching the values of generated
columns, (2) omit generated columns from the output, too, if we're
using --column-inserts.  While these modes aren't expected to be
as high-performance as the COPY path, we might as well be as
efficient as we can; it doesn't add much complexity.

Per report from Дмитрий Иванов.
Back-patch to v12 where generated columns came in.

Discussion: https://postgr.es/m/CAPL5KHrkBniyQt5e1rafm5DdXvbgiiqfEQEJ9GjtVzN71Jj5pA@mail.gmail.com
2021-11-22 15:25:48 -05:00
..
backend Add missing words in comment 2021-11-22 12:38:41 -03:00
bin Fix pg_dump --inserts mode for generated columns with dropped columns. 2021-11-22 15:25:48 -05:00
common Fix buffer overrun in unicode string normalization with empty input 2021-11-11 15:01:45 +09:00
fe_utils
include Fix parallel operations that prevent oldest xmin from advancing. 2021-11-19 09:14:09 +05:30
interfaces libpq: reject extraneous data after SSL or GSS encryption handshake. 2021-11-08 11:14:56 -05:00
makefiles
pl Translation updates 2021-11-08 10:06:30 +01:00
port
template
test Fix SP-GiST scan initialization logic for binary-compatible cases. 2021-11-20 14:29:56 -05:00
timezone Update time zone data files to tzdata release 2021e. 2021-10-29 11:38:32 -04:00
tools Avoid race in RelationBuildDesc() affecting CREATE INDEX CONCURRENTLY. 2021-10-23 18:36:42 -07:00
tutorial
.gitignore
DEVELOPERS
Makefile
Makefile.global.in Add module build directory to the PATH for TAP tests 2021-10-22 09:50:16 -04:00
Makefile.shlib
nls-global.mk