Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
> pg_get_constraintdef() fails rather easily:
> =# select pg_get_constraintdef(1);
> ERROR: cache lookup failed for constraint 1
It's expected that the caller will supply a valid pg_constraint OID.
I don't think it's necessary to go out of our way to throw a friendlier
error message if the OID isn't found.
regards, tom lane