Re: Should new partitions inherit their tablespace from their parent? - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Should new partitions inherit their tablespace from their parent?
Date
Msg-id 20181216220735.ra2pz2dbhuapsfjh@alvherre.pgsql
Whole thread Raw
In response to Re: Should new partitions inherit their tablespace from their parent?  (David Rowley <david.rowley@2ndquadrant.com>)
Responses Re: Should new partitions inherit their tablespace from their parent?
Re: Should new partitions inherit their tablespace from their parent?
List pgsql-hackers
I didn't like this, so I rewrote it a little bit.

First, I changed the Assert() to use the macro for relations with
storage that I just posted in the other thread that Michael mentioned.

I then noticed that we're doing a heap_openrv() in the parent relation
and closing it before MergeAttribute() does the same thing all over
again; also MergeAttribute has the silly array-of-OIDs return value for
the parents so that DefineRelation can handle it again later.  Rube
Goldberg says hi.  I changed this so that *before* doing anything with
the parent list, we transform it to a list of OIDs, and lock them; so
MergeAttributes now receives the list of OIDs of parents rather than
RangeVars.  We can also move the important comment (about lock level of
parent rels) buried in the bowels of MergeAttribute to the place where
it belongs in DefineRelation; and we no longer have to mess with
transforming names to OIDs multiple times.

Proposed patch attached.

I'll self-review this again tomorrow, 'cause I now have to run.

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

Attachment

pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: gist microvacuum doesn't appear to care about hot standby?
Next
From: Andres Freund
Date:
Subject: Re: gist microvacuum doesn't appear to care about hot standby?