]> granicus.if.org Git - postgresql/commit
Tweak pg_partition_tree for undefined relations and unsupported relkinds
authorMichael Paquier <michael@paquier.xyz>
Wed, 12 Dec 2018 00:49:39 +0000 (09:49 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 12 Dec 2018 00:49:39 +0000 (09:49 +0900)
commitcc53123bcc9d8786acae2885c3a0897b7be34a02
treeb4c2e06c6a4afe5f651ea7fb192b3a4d460ef065
parent7a28e9aa0fd966ed374d244896e397148336720a
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
src/backend/utils/adt/partitionfuncs.c
src/test/regress/expected/partition_info.out
src/test/regress/sql/partition_info.sql