summaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw/option.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-11-22 15:25:48 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2021-11-22 15:25:48 -0500
commit6fc8b145e74303bfba6bd21fd7c33d343ee37d44 (patch)
treed98c7596bb9247272310ce70b5fa2f4210449934 /contrib/postgres_fdw/option.c
parentec383ca2df0a6f77a9b49dcd8853e76e6b328d37 (diff)
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
Diffstat (limited to 'contrib/postgres_fdw/option.c')
0 files changed, 0 insertions, 0 deletions