Re: Broken defenses against dropping a partitioning column
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org, Manuel Rigger <rigger.manuel@gmail.com>
Date: 2019-07-08T14:31:53Z
Lists: pgsql-hackers
On 2019-Jul-07, Tom Lane wrote: > Ideally, perhaps, a DROP CASCADE like this would not cascade to > the whole table but only to the table's partitioned-ness property, > leaving you with a non-partitioned table with most of its data > intact. It would take a lot of work to make that happen though, > and it certainly wouldn't be back-patchable, and I'm not really > sure it's worth it. Maybe we can add dependencies to rows of the pg_partitioned_table relation, with the semantics of "depends on the partitioned-ness of the table"? That said, I'm not sure I see the use case for an ALTER TABLE .. DROP COLUMN command that turns a partitioned table (with existing partitions containing data) into one non-partitioned table with all data minus the partitioning column(s). This seems vaguely related to the issue of dropping foreign keys; see https://postgr.es/m/20190329152239.GA29258@alvherre.pgsql wherein I settled with a non-ideal solution to the problem of being unable to depend on something that did not cause the entire table to be dropped in certain cases. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Make pg_upgrade's test.sh less chatty.
- 8d21512dc34f 11.5 landed
- 7ac7bf50cc9a 10.10 landed
- 75348a733225 9.6.15 landed
- 69c3d519112f 9.5.19 landed
- 19f9a5aed9a7 9.4.24 landed
-
Install dependencies to prevent dropping partition key columns.
- a0555ddab9b6 13.0 landed
- 79e573fa4986 12.0 landed
- 6cdefc82ba9d 11.5 landed
- 0e1deaa4c424 10.10 landed