pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Make pg_dump emit ATTACH PARTITION instead of PARTITION OF 6+ messages / 1 participants [nested] [flat]
* pgsql: Make pg_dump emit ATTACH PARTITION instead of PARTITION OF @ 2019-04-24 19:32 Alvaro Herrera <alvherre@alvh.no-ip.org> 0 siblings, 0 replies; 6+ messages in thread From: Alvaro Herrera @ 2019-04-24 19:32 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Make pg_dump emit ATTACH PARTITION instead of PARTITION OF Using PARTITION OF can result in column ordering being changed from the database being dumped, if the partition uses a column layout different from the parent's. It's not pg_dump's job to editorialize on table definitions, so this is not acceptable; back-patch all the way back to pg10, where partitioned tables where introduced. This change also ensures that partitions end up in the correct tablespace, if different from the parent's; this is an oversight in ca4103025dfe (in pg12 only). Partitioned indexes (in pg11) don't have this problem, because they're already created as independent indexes and attached to their parents afterwards. This change also has the advantage that the partition is restorable from the dump (as a standalone table) even if its parent table isn't restored. Author: David Rowley Reviewed-by: Álvaro Herrera Discussion: https://postgr.es/m/CAKJS1f_1c260nOt_vBJ067AZ3JXptXVRohDVMLEBmudX1YEx-A@mail.gmail.com Discussion: https://postgr.es/m/20190423185007.GA27954@alvherre.pgsql Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/3b23552ad8bbb1384381b67f860019d14d5b680e Modified Files -------------- src/bin/pg_dump/pg_dump.c | 123 ++++++++++++++++----------------------- src/bin/pg_dump/t/002_pg_dump.pl | 12 +++- 2 files changed, 60 insertions(+), 75 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Make pg_dump emit ATTACH PARTITION instead of PARTITION OF @ 2019-04-24 19:32 Alvaro Herrera <alvherre@alvh.no-ip.org> 0 siblings, 0 replies; 6+ messages in thread From: Alvaro Herrera @ 2019-04-24 19:32 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Make pg_dump emit ATTACH PARTITION instead of PARTITION OF Using PARTITION OF can result in column ordering being changed from the database being dumped, if the partition uses a column layout different from the parent's. It's not pg_dump's job to editorialize on table definitions, so this is not acceptable; back-patch all the way back to pg10, where partitioned tables where introduced. This change also ensures that partitions end up in the correct tablespace, if different from the parent's; this is an oversight in ca4103025dfe (in pg12 only). Partitioned indexes (in pg11) don't have this problem, because they're already created as independent indexes and attached to their parents afterwards. This change also has the advantage that the partition is restorable from the dump (as a standalone table) even if its parent table isn't restored. Author: David Rowley Reviewed-by: Álvaro Herrera Discussion: https://postgr.es/m/CAKJS1f_1c260nOt_vBJ067AZ3JXptXVRohDVMLEBmudX1YEx-A@mail.gmail.com Discussion: https://postgr.es/m/20190423185007.GA27954@alvherre.pgsql Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a98c48debcd0620ab07608d53ee08fdb0e7a1edb Modified Files -------------- src/bin/pg_dump/pg_dump.c | 123 ++++++++++++++++----------------------- src/bin/pg_dump/t/002_pg_dump.pl | 12 +++- 2 files changed, 60 insertions(+), 75 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Make pg_dump emit ATTACH PARTITION instead of PARTITION OF @ 2019-04-24 19:32 Alvaro Herrera <alvherre@alvh.no-ip.org> 0 siblings, 0 replies; 6+ messages in thread From: Alvaro Herrera @ 2019-04-24 19:32 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Make pg_dump emit ATTACH PARTITION instead of PARTITION OF Using PARTITION OF can result in column ordering being changed from the database being dumped, if the partition uses a column layout different from the parent's. It's not pg_dump's job to editorialize on table definitions, so this is not acceptable; back-patch all the way back to pg10, where partitioned tables where introduced. This change also ensures that partitions end up in the correct tablespace, if different from the parent's; this is an oversight in ca4103025dfe (in pg12 only). Partitioned indexes (in pg11) don't have this problem, because they're already created as independent indexes and attached to their parents afterwards. This change also has the advantage that the partition is restorable from the dump (as a standalone table) even if its parent table isn't restored. Author: David Rowley Reviewed-by: Álvaro Herrera Discussion: https://postgr.es/m/CAKJS1f_1c260nOt_vBJ067AZ3JXptXVRohDVMLEBmudX1YEx-A@mail.gmail.com Discussion: https://postgr.es/m/20190423185007.GA27954@alvherre.pgsql Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5a191f697400560fa8f2cc11817072bf9055de73 Modified Files -------------- src/bin/pg_dump/pg_dump.c | 123 ++++++++++++++++----------------------- src/bin/pg_dump/t/002_pg_dump.pl | 13 +++-- 2 files changed, 58 insertions(+), 78 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Make pg_dump emit ATTACH PARTITION instead of PARTITION OF (repr @ 2019-06-10 22:58 Alvaro Herrera <alvherre@alvh.no-ip.org> 0 siblings, 0 replies; 6+ messages in thread From: Alvaro Herrera @ 2019-06-10 22:58 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Make pg_dump emit ATTACH PARTITION instead of PARTITION OF (reprise) Using PARTITION OF can result in column ordering being changed from the database being dumped, if the partition uses a column layout different from the parent's. It's not pg_dump's job to editorialize on table definitions, so this is not acceptable; back-patch all the way back to pg10, where partitioned tables where introduced. This change also ensures that partitions end up in the correct tablespace, if different from the parent's; this is an oversight in ca4103025dfe (in pg12 only). Partitioned indexes (in pg11) don't have this problem, because they're already created as independent indexes and attached to their parents afterwards. This change also has the advantage that the partition is restorable from the dump (as a standalone table) even if its parent table isn't restored. The original commits (3b23552ad8bb in branch master) failed to cover subsidiary column elements correctly, such as NOT NULL constraint and CHECK constraints, as reported by Rushabh Lathia (initially as a failure to restore serial columns). They were reverted. This recapitulation commit fixes those problems. Add some pg_dump tests to verify these things more exhaustively, including constraints with legacy-inheritance tables, which were not tested originally. In branches 10 and 11, add a local constraint to the pg_dump test partition that was added by commit 2d7eeb1b1492 to master. Author: Álvaro Herrera, David Rowley Reviewed-by: Álvaro Herrera Discussion: https://postgr.es/m/CAKJS1f_1c260nOt_vBJ067AZ3JXptXVRohDVMLEBmudX1YEx-A@mail.gmail.com Discussion: https://postgr.es/m/20190423185007.GA27954@alvherre.pgsql Discussion: https://postgr.es/m/CAGPqQf0iQV=PPOv2Btog9J9AwOQp6HmuVd6SbGTR_v3Zp2XT1w@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/33a53130a89447e171a8268ae0b221bb48af6468 Modified Files -------------- src/bin/pg_dump/pg_dump.c | 158 +++++++++++++++++++-------------------- src/bin/pg_dump/t/002_pg_dump.pl | 72 +++++++++++++++--- 2 files changed, 138 insertions(+), 92 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Make pg_dump emit ATTACH PARTITION instead of PARTITION OF (repr @ 2019-06-10 22:58 Alvaro Herrera <alvherre@alvh.no-ip.org> 0 siblings, 0 replies; 6+ messages in thread From: Alvaro Herrera @ 2019-06-10 22:58 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Make pg_dump emit ATTACH PARTITION instead of PARTITION OF (reprise) Using PARTITION OF can result in column ordering being changed from the database being dumped, if the partition uses a column layout different from the parent's. It's not pg_dump's job to editorialize on table definitions, so this is not acceptable; back-patch all the way back to pg10, where partitioned tables where introduced. This change also ensures that partitions end up in the correct tablespace, if different from the parent's; this is an oversight in ca4103025dfe (in pg12 only). Partitioned indexes (in pg11) don't have this problem, because they're already created as independent indexes and attached to their parents afterwards. This change also has the advantage that the partition is restorable from the dump (as a standalone table) even if its parent table isn't restored. The original commits (3b23552ad8bb in branch master) failed to cover subsidiary column elements correctly, such as NOT NULL constraint and CHECK constraints, as reported by Rushabh Lathia (initially as a failure to restore serial columns). They were reverted. This recapitulation commit fixes those problems. Add some pg_dump tests to verify these things more exhaustively, including constraints with legacy-inheritance tables, which were not tested originally. In branches 10 and 11, add a local constraint to the pg_dump test partition that was added by commit 2d7eeb1b1492 to master. Author: Álvaro Herrera, David Rowley Reviewed-by: Álvaro Herrera Discussion: https://postgr.es/m/CAKJS1f_1c260nOt_vBJ067AZ3JXptXVRohDVMLEBmudX1YEx-A@mail.gmail.com Discussion: https://postgr.es/m/20190423185007.GA27954@alvherre.pgsql Discussion: https://postgr.es/m/CAGPqQf0iQV=PPOv2Btog9J9AwOQp6HmuVd6SbGTR_v3Zp2XT1w@mail.gmail.com Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/6a781c4f5fecc5cde5444459f4cd187872487bda Modified Files -------------- src/bin/pg_dump/pg_dump.c | 158 +++++++++++++++++++-------------------- src/bin/pg_dump/t/002_pg_dump.pl | 78 +++++++++++++++---- 2 files changed, 143 insertions(+), 93 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Make pg_dump emit ATTACH PARTITION instead of PARTITION OF (repr @ 2019-06-10 22:58 Alvaro Herrera <alvherre@alvh.no-ip.org> 0 siblings, 0 replies; 6+ messages in thread From: Alvaro Herrera @ 2019-06-10 22:58 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Make pg_dump emit ATTACH PARTITION instead of PARTITION OF (reprise) Using PARTITION OF can result in column ordering being changed from the database being dumped, if the partition uses a column layout different from the parent's. It's not pg_dump's job to editorialize on table definitions, so this is not acceptable; back-patch all the way back to pg10, where partitioned tables where introduced. This change also ensures that partitions end up in the correct tablespace, if different from the parent's; this is an oversight in ca4103025dfe (in pg12 only). Partitioned indexes (in pg11) don't have this problem, because they're already created as independent indexes and attached to their parents afterwards. This change also has the advantage that the partition is restorable from the dump (as a standalone table) even if its parent table isn't restored. The original commits (3b23552ad8bb in branch master) failed to cover subsidiary column elements correctly, such as NOT NULL constraint and CHECK constraints, as reported by Rushabh Lathia (initially as a failure to restore serial columns). They were reverted. This recapitulation commit fixes those problems. Add some pg_dump tests to verify these things more exhaustively, including constraints with legacy-inheritance tables, which were not tested originally. In branches 10 and 11, add a local constraint to the pg_dump test partition that was added by commit 2d7eeb1b1492 to master. Author: Álvaro Herrera, David Rowley Reviewed-by: Álvaro Herrera Discussion: https://postgr.es/m/CAKJS1f_1c260nOt_vBJ067AZ3JXptXVRohDVMLEBmudX1YEx-A@mail.gmail.com Discussion: https://postgr.es/m/20190423185007.GA27954@alvherre.pgsql Discussion: https://postgr.es/m/CAGPqQf0iQV=PPOv2Btog9J9AwOQp6HmuVd6SbGTR_v3Zp2XT1w@mail.gmail.com Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1eb8a5ea463dcbe6546f684e862649fd4e643953 Modified Files -------------- src/bin/pg_dump/pg_dump.c | 158 +++++++++++++++++++-------------------- src/bin/pg_dump/t/002_pg_dump.pl | 120 ++++++++++++++++++++++++----- 2 files changed, 181 insertions(+), 97 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2019-06-10 22:58 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-04-24 19:32 pgsql: Make pg_dump emit ATTACH PARTITION instead of PARTITION OF Alvaro Herrera <alvherre@alvh.no-ip.org> 2019-04-24 19:32 pgsql: Make pg_dump emit ATTACH PARTITION instead of PARTITION OF Alvaro Herrera <alvherre@alvh.no-ip.org> 2019-04-24 19:32 pgsql: Make pg_dump emit ATTACH PARTITION instead of PARTITION OF Alvaro Herrera <alvherre@alvh.no-ip.org> 2019-06-10 22:58 pgsql: Make pg_dump emit ATTACH PARTITION instead of PARTITION OF (repr Alvaro Herrera <alvherre@alvh.no-ip.org> 2019-06-10 22:58 pgsql: Make pg_dump emit ATTACH PARTITION instead of PARTITION OF (repr Alvaro Herrera <alvherre@alvh.no-ip.org> 2019-06-10 22:58 pgsql: Make pg_dump emit ATTACH PARTITION instead of PARTITION OF (repr Alvaro Herrera <alvherre@alvh.no-ip.org>
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