Tweak pg_partition_tree for undefined relations and unsupported relkinds

Michael Paquier <michael@paquier.xyz>

Commit: cc53123bcc9d8786acae2885c3a0897b7be34a02
Author: Michael Paquier <michael@paquier.xyz>
Date: 2018-12-12T00:49:39Z
Releases: 12.0
Tweak pg_partition_tree for undefined relations and unsupported relkinds

This fixes a crash which happened when calling the function directly
with a relation OID referring to a non-existing object, and changes the
behavior so as NULL is returned for unsupported relkinds instead of
generating an error.  This puts the new function in line with many other
system functions, and eases actions like full scans of pg_class.

Author: Michael Paquier
Reviewed-by: Amit Langote, Stephen Frost
Discussion: https://postgr.es/m/20181207010406.GO2407@paquier.xyz

Files

Discussion