Native partitioning tablespace inheritance

Поиск
Список
Период
Сортировка
От Keith Fiske
Тема Native partitioning tablespace inheritance
Дата
Msg-id CAODZiv6EBULTz1dP2KV84XMGgDaG=R3TxodK+ovwHSPWECK8sQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Native partitioning tablespace inheritance  (Michael Paquier <michael@paquier.xyz>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 'make check' fails
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Creation of wiki page for open items of v11