Re: [HACKERS] Partitioned tables and relfilenode - Mailing list pgsql-hackers

From Amit Langote
Subject Re: [HACKERS] Partitioned tables and relfilenode
Date
Msg-id b82e3cba-3085-658a-02ad-5a1838235499@lab.ntt.co.jp
Whole thread Raw
In response to Re: [HACKERS] Partitioned tables and relfilenode  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On 2017/02/28 12:29, Michael Paquier wrote:
> On Tue, Feb 28, 2017 at 12:23 PM, Bruce Momjian <bruce@momjian.us> wrote:
>> I am a little confused by the above.  Is a partitioned table the parent
>> or the children?  Reading the code it seems it is the parent, which
>> explains why it works.  Can I clarify that?
> 
> As I understand things, a partitioned table is a parent relation that
> exists only to link to its child portions, holding as well the
> definitions linking to each partition.

Yes.  As I mentioned in my previous email, data inserted into the
partitioned table is routed to its partitions.  A partition may be itself
a partitioned table, so the routing continues until we find a leaf
partition.  All the partitioned tables in this chain leading to the leaf
partition are RELKIND_PARTITIONED_TABLE ('P') relations and only the leaf
tables are RELKIND_RELATION tables.

Thanks,
Amit





pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] PATCH: two slab-like memory allocators
Next
From: Jim Nasby
Date:
Subject: Re: [HACKERS] increasing the default WAL segment size