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