Justin Pryzby <pry...@telsasoft.com> writes:
> pg_get_partition_constraintdef() doesn't like being passed a relkind='I',

It'll also fall over if the passed OID isn't a relation at all, which
is also very much not-nice for SQL-exposed inquiry functions.

I'm inclined to fix this by

(1) inventing an lsyscache function to fetch relispartition, which
will have the behavior of returning false for a lookup failure
(which is generally consistent with the behavior of most of the
other lsyscache functions).

(2) replace the if (rel->rd_rel->relispartition) check in
get_partition_qual_relid with a test like if (get_rel_relispartition(relid)),
and don't open the Relation at all unless that succeeds.

                        regards, tom lane

Reply via email to