Re: [HACKERS] Effect of dropping a partitioned table's column over time

2017-08-07 Thread Robert Haas
On Sun, Aug 6, 2017 at 11:38 PM, Craig Ringer wrote: > Can we instead create the new partitions with the same dropped columns? > > Ensure that every partition, parent and child, has the same column-set? We could, but that has costs of its own. It means that those calls

Re: [HACKERS] Effect of dropping a partitioned table's column over time

2017-08-06 Thread Craig Ringer
On 7 August 2017 at 11:25, Thomas Munro wrote: > On Mon, Aug 7, 2017 at 2:20 PM, Tom Lane wrote: > > Thomas Munro writes: > >> Since partitioned tables have no storage themselves, is there > >> any technical

Re: [HACKERS] Effect of dropping a partitioned table's column over time

2017-08-06 Thread Thomas Munro
On Mon, Aug 7, 2017 at 2:35 PM, Amit Langote wrote: > On 2017/08/07 10:58, Thomas Munro wrote: >> Of course there are other usage patterns where you might prefer it >> this way, because you'll mostly be inserting into partitions created >> before the change. In

Re: [HACKERS] Effect of dropping a partitioned table's column over time

2017-08-06 Thread Thomas Munro
On Mon, Aug 7, 2017 at 2:20 PM, Tom Lane wrote: > Thomas Munro writes: >> Since partitioned tables have no storage themselves, is there >> any technical reason we couldn't remove a partitioned table's dropped >> pg_attribute so that its

Re: [HACKERS] Effect of dropping a partitioned table's column over time

2017-08-06 Thread Amit Langote
Hi Thomas, On 2017/08/07 10:58, Thomas Munro wrote: > Hi hackers, > > If you drop a column from a partitioned table then it has a TupleDesc > that matches existing partitions, but new partitions created after > that have non-same TupleDescs (according to convert_tuples_by_name) > because they

Re: [HACKERS] Effect of dropping a partitioned table's column over time

2017-08-06 Thread Tom Lane
Thomas Munro writes: > Since partitioned tables have no storage themselves, is there > any technical reason we couldn't remove a partitioned table's dropped > pg_attribute so that its TupleDesc matches partitions created later? You'd break views referring to the

[HACKERS] Effect of dropping a partitioned table's column over time

2017-08-06 Thread Thomas Munro
Hi hackers, If you drop a column from a partitioned table then it has a TupleDesc that matches existing partitions, but new partitions created after that have non-same TupleDescs (according to convert_tuples_by_name) because they don't have the dropped column. That means that inserts to