pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix pg_dump --inserts mode for generated columns with dropped co 4+ messages / 1 participants [nested] [flat]
* pgsql: Fix pg_dump --inserts mode for generated columns with dropped co @ 2021-11-22 20:26 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2021-11-22 20:26 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/aedc4600d84dd1ebd9386e72ac78f329b8be4804 Modified Files -------------- src/bin/pg_dump/pg_dump.c | 51 ++++++++++++++++++++++++----- src/bin/pg_dump/t/002_pg_dump.pl | 69 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 111 insertions(+), 9 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Fix pg_dump --inserts mode for generated columns with dropped co @ 2021-11-22 20:26 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2021-11-22 20:26 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/6fc8b145e74303bfba6bd21fd7c33d343ee37d44 Modified Files -------------- src/bin/pg_dump/pg_dump.c | 51 ++++++++++++++++++++++++----- src/bin/pg_dump/t/002_pg_dump.pl | 69 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 111 insertions(+), 9 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Fix pg_dump --inserts mode for generated columns with dropped co @ 2021-11-22 20:26 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2021-11-22 20:26 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1e7f588ad625ac5a14ef7c735cbce13b9d3f5be6 Modified Files -------------- src/bin/pg_dump/pg_dump.c | 51 ++++++++++++++++++++++++----- src/bin/pg_dump/t/002_pg_dump.pl | 69 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 111 insertions(+), 9 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Fix pg_dump --inserts mode for generated columns with dropped co @ 2021-11-22 20:26 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2021-11-22 20:26 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/0b126c6a4b00972f2f3533e1718bbe297e2851c2 Modified Files -------------- src/bin/pg_dump/pg_dump.c | 51 ++++++++++++++++++++++++----- src/bin/pg_dump/t/002_pg_dump.pl | 69 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 111 insertions(+), 9 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2021-11-22 20:26 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-11-22 20:26 pgsql: Fix pg_dump --inserts mode for generated columns with dropped co Tom Lane <tgl@sss.pgh.pa.us> 2021-11-22 20:26 pgsql: Fix pg_dump --inserts mode for generated columns with dropped co Tom Lane <tgl@sss.pgh.pa.us> 2021-11-22 20:26 pgsql: Fix pg_dump --inserts mode for generated columns with dropped co Tom Lane <tgl@sss.pgh.pa.us> 2021-11-22 20:26 pgsql: Fix pg_dump --inserts mode for generated columns with dropped co Tom Lane <tgl@sss.pgh.pa.us>
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