Re: pg_dump is broken for partition tablespaces

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: pg_dump is broken for partition tablespaces
Date: 2019-03-06 11:26:21
Message-ID: CAKJS1f_iyBpAuYBPQv_GGeME=g9Rpr8yWjCaYV4E685yQ1uzkw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 6 Mar 2019 at 20:19, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Wed, Mar 06, 2019 at 07:45:06PM +1300, David Rowley wrote:
> > Can anyone see any fundamental reason that we should not create a
> > partitioned table by doing CREATE TABLE followed by ATTACH PARTITION?
> > If not, I'll write a patch that fixes it that way.
>
> The part for partitioned indexes is already battle-proven, so if the
> part for partitioned tables can be consolidated the same way that
> would be really nice.

I think Andres is also going to need it to work this way for the
pluggable storage patch too.

Looking closer at this, I discovered that when pg_dump is in binary
upgrade mode that it crafts the pg_dump output in this way anyway...
Obviously, the column orders can't go changing magically in that case
since we're about to plug the old heap into the new table. Due to the
removal of the special case, it means this patch turned out to remove
more code than it adds.

Patch attached.

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
v1-0001-Make-pg_dump-emit-ATTACH-PARTITION-instead-of-PAR.patch application/octet-stream 8.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2019-03-06 11:31:09 Re: Inheriting table AMs for partitioned tables
Previous Message Antonin Houska 2019-03-06 11:12:10 openLogOff is not needed anymore