Re: pg_dump is broken for partition tablespaces
David Rowley <david.rowley@2ndquadrant.com>
From: David Rowley <david.rowley@2ndquadrant.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Andres Freund <andres@anarazel.de>, Tom Lane <tgl@sss.pgh.pa.us>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-04-23T23:02:41Z
Lists: pgsql-hackers
On Wed, 24 Apr 2019 at 10:26, Alvaro Herrera <alvherre@2ndquadrant.com> wrote: > If creating a partition, there is the additional rule that parent's > tablespace overrides default_tablespace: > > a2. if there's a TABLESPACE clause, use that. > b2. otherwise, if the parent has a tablespace, use that. > c2. otherwise, if there's a default_tablespace, use that. > d2. otherwise, use the database tablespace. > e2. if we end up with the database tablespace, overwrite with 0. Wouldn't it just take the proposed pg_dump change to get that? rule e2 says we'll store 0 in reltablespace, even if the user does TABLESPACE pg_default, so there's no requirement to adjust the hack in heap_create to put any additional conditions on when we set reltablespace to 0, so it looks like none of the patching work you did would be required to implement this. Right? The good part about that is that its consistent with what happens if the user does TABLESPACE pg_default for any other object type that supports tablespaces. i.e we always store 0. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
Commits
-
Make pg_dump emit ATTACH PARTITION instead of PARTITION OF (reprise)
- 6a781c4f5fec 11.4 landed
- 33a53130a894 12.0 landed
- 1eb8a5ea463d 10.9 landed
-
Fix tablespace inheritance for partitioned rels
- 87259588d0ab 12.0 landed
-
Make pg_dump emit ATTACH PARTITION instead of PARTITION OF
- a98c48debcd0 11.3 landed
- 5a191f697400 10.8 landed
- 3b23552ad8bb 12.0 landed
-
Make sure ALTER TABLE preserves index tablespaces.
- bd673e8e864a 10.0 cited