Native partitioning tablespace inheritance - Mailing list pgsql-hackers

From Keith Fiske
Subject Native partitioning tablespace inheritance
Date
Msg-id CAODZiv6EBULTz1dP2KV84XMGgDaG=R3TxodK+ovwHSPWECK8sQ@mail.gmail.com
Whole thread Raw
Responses Re: Native partitioning tablespace inheritance
List pgsql-hackers
Just had someone report that pg_partman wasn't handling tablespaces for native partitioning. 


I'd assumed that that was a property that was being inherited from the parent table, but apparently the TABLESPACE flag to CREATE TABLE is completely ignored for the parent table. I know the documentation states that you can set the tablespace per child table, but accepting the flag on the parent and completely ignoring it seems rather misleading to me. 

keith@keith=# CREATE TABLE XXXX(YYYYYY TIMESTAMP NOT NULL) PARTITION BY RANGE (YYYYYY ) TABLESPACE mytablespace;
CREATE TABLE
Time: 11.569 ms
keith@keith=# \d+ xxxx;
                                             Table "public.xxxx"
 Column |            Type             | Collation | Nullable | Default | Storage | Stats target | Description 
--------+-----------------------------+-----------+----------+---------+---------+--------------+-------------
 yyyyyy | timestamp without time zone |           | not null |         | plain   |              | 
Partition key: RANGE (yyyyyy)

keith@keith=# select relname, reltablespace from pg_class where relname = 'xxxx';
 relname | reltablespace 
---------+---------------
 xxxx    |             0
(1 row)


Any chance of this being an inheritable property that can simply be overridden if the TABLESPACE flag is set when creating a child table? If it's not set, just set the tablespace to whatever was set for the parent.  

For now, partman is going to have to rely on the template table option to handle this the same way it does for indexes right now.

--
Keith Fiske
Senior Database Engineer
Crunchy Data - http://crunchydata.com

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: 'make check' fails
Next
From: Alvaro Herrera
Date:
Subject: Re: Creation of wiki page for open items of v11