move PartitionBoundInfo creation code

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: move PartitionBoundInfo creation code
Date: 2018-11-01 03:58:29
Message-ID: 3f289da8-6d10-75fe-814a-635e8b191d43@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Currently, the code that creates a PartitionBoundInfo struct from the
PartitionBoundSpec nodes of constituent partitions read from the catalog
is in RelationBuildPartitionDesc that's in partcache.c. I think that
da6f3e45dd that moved around the partitioning code [1] really missed the
opportunity to move the aforementioned code into partbounds.c. I think
there is quite a bit of logic contained in that code that can aptly be
said to belong in partbounds.c. Also, if factored out into a function of
its own with a proper interface, it could be useful to other callers that
may want to build it for, say, fake partitions [2] which are not real
relations.

Attached find a patch that does such refactoring, along with making some
functions in partbounds.c that are not needed outside static.

Thanks,
Amit

[1] https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=da6f3e45ddb

[2]
https://www.postgresql.org/message-id/009901d3f34c%2471e1bdc0%2455a53940%24%40lab.ntt.co.jp

Attachment Content-Type Size
v1-0001-Move-PartitionBoundInfo-creation-code-to-partboun.patch text/plain 36.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-11-01 04:02:22 Re: move PartitionBoundInfo creation code
Previous Message Amit Langote 2018-11-01 03:39:16 Re: Getting ERROR: could not open file "base/13164/t3_16388" with partition table with ON COMMIT