On Tue, 20 Nov 2018 at 01:47, Tomas Vondra <tomas.von...@2ndquadrant.com> wrote: > The patch seems fine to me.
Thanks for looking at it. > It's a bit unfortunate that we simply disable the optimization on > partitioned tables instead of fixing it somehow, but I guess it's better > than nothing and no one has a very good idea how to make it work. Yeah, I agree. I added various comments in the patch to explain why we're not going to the trouble of allowing it. I had hoped that would do for now. Lately, there's quite a bit of effort going into reducing various overheads to having a partitioned table with high numbers of partitions. A patch to speed up INSERT was just committed, for example. Perhaps COPY is less critical to make faster for inserting small numbers of rows, but I'd not rule out someone complaining sometime about the overhead of checking all partitions are compatible with the freeze optimisation before doing the COPY, although, perhaps we can just tell those people not to use the FREEZE option. Anyway, I was mostly interested in fixing the bug. Making COPY FREEZE work with partitioned tables sounds like a new feature. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services