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

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Should new partitions inherit their tablespace from their parent?
Дата
Msg-id 20181207071508.GS2407@paquier.xyz
обсуждение исходный текст
Ответ на Re: Should new partitions inherit their tablespace from their parent?  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Should new partitions inherit their tablespace from their parent?  (David Rowley <david.rowley@2ndquadrant.com>)
Список pgsql-hackers
On Sat, Nov 24, 2018 at 10:18:17AM +0900, Michael Paquier wrote:
> On Sat, Nov 24, 2018 at 12:32:36PM +1300, David Rowley wrote:
>> On Fri, 23 Nov 2018 at 17:03, David Rowley <david.rowley@2ndquadrant.com> wrote:
>> > Here's a patch for that.  Parking here until January's commitfest.
>>
>> And another, now rebased atop of de38ce1b8 (which I probably should
>> have waited for).

Thanks for the patch, David.  I can see that this patch makes the code
more consistent for partitioned tables and partitioned indexes when it
comes to tablespace handling, which is a very good thing.

-ATExecPartedIdxSetTableSpace(Relation rel, Oid newTableSpace)
+ATExecSetTableSpaceNoStorage(Relation rel, Oid newTableSpace)
NoStorage looks strange as routine name for this case.  Would something
like ATExecPartedRelSetTableSpace be more adapted perhaps?

+   else if (stmt->partbound)
+   {
+       RangeVar   *parent;
+       Relation    parentrel;
+
+       /*
+        * For partitions, when no other tablespace is specified, we default
+        * the tablespace to the parent partitioned table's.
+        */
Okay, so the direct parent is what counts, and not the top-most parent.
Could you add a test with multiple level of partitioned tables, like:
- parent is in tablespace 1.
- child is created in tablespace 2.
- grandchild is created, which should inherit tablespace 2 from the
child, but not tablespace 1 from the parent.  In the existing example,
as one partition is used to test the top-most parent and another for the
new default, it looks cleaner to create a third partition which would be
itself a partitioned table.
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Noah Misch
Дата:
Сообщение: Re: Support custom socket directory in pg_upgrade
Следующее
От: Noah Misch
Дата:
Сообщение: Re: Too many logs are written on Windows (LOG: could not reserveshared memory region (addr=%p) for child %p:)