A new C function `get_partition_root`. - Mailing list pgsql-hackers

From Peter Smith
Subject A new C function `get_partition_root`.
Date
Msg-id CAHut+Ptc73UpWSn4teMyMxQoHwGJjRwhWiu=hGJqAj5k2AOXEw@mail.gmail.com
Whole thread
List pgsql-hackers
This patch introduces a new C function `get_partition_root`.

WHY?

1. It is the C equivalent of the already-existing SQL function
`pg_partition_root`

2. Some code is not interested in the partition "ancestors", yet it
still had to declare/fetch/free an ancestors list to obtain the root
relid at llast_oid(ancestors).

3. The logical replication FOR TABLES IN SCHEMA EXCEPT (...) patches
[1] (still in development) have many more code fragments like this
where the logic wants only the partition root OID -- This function
would simplify all those.

~~~

PSA v1

Passes make check-world.

Thoughts?

======
[1]
https://www.postgresql.org/message-id/flat/CABdArM5sw4Q1ZU8HGdo4BSc1A_%2B8xtUNq17j6wcir%3DyMUy19Cg%40mail.gmail.com

Kind Regards,
Peter Smith.
Fujitsu Australia

Attachment

pgsql-hackers by date:

Previous
From: Ian Lawrence Barwick
Date:
Subject: [PATCH] Add pg_get_event_trigger_ddl() function
Next
From: Peter Smith
Date:
Subject: Re: Support EXCEPT for TABLES IN SCHEMA publications