Re: Should new partitions inherit their tablespace from their parent?

Alvaro Herrera <alvherre@2ndquadrant.com>

From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Michael Paquier <michael@paquier.xyz>, Robert Haas <robertmhaas@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2018-12-17T19:21:18Z
Lists: pgsql-hackers
On 2018-Dec-18, David Rowley wrote:

> 1. Shouldn't you be using the RangeVarGetRelid() macro instead of
> calling RangeVarGetRelidExtended()?

This should have been obvious but I didn't notice.

> 2. In MergeAttributes(), the parentOids list still exists and is
> populated.  This is now only used to determine if the "supers" list
> contains any duplicate Oids. Maybe it's better to rename that list to
> something like "seenOids" to avoid any confusion with the "supers"
> list. Or maybe it's worth thinking of a better way to detect duplicate
> items in the "supers" list.

Good catch.

What I did was move the duplicate detection to the loop doing
RangeVarGetRelid, and remove parentOids from MergeAttributes.

Pushed with those changes.  Thanks for the patch!

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Commits

  1. Fix tablespace handling for partitioned tables