On Thu, May 13, 2021 at 4:49 PM Tom Lane <t...@sss.pgh.pa.us> wrote: > The main reason I'm concerned about applying that rule to amvalidate > is that then how do you know what's actually an error case? > > As a hardly-irrelevant counterexample, we have a whole bunch of > regression tests that do something like > > SELECT ... > WHERE NOT amvalidate(oid); > > Every one of those is silently and dangerously wrong if amvalidate > might sometimes return null.
Oh, I didn't notice previously that Justin's proposal was to make the functions return NULL. He's correct that this is consistent with other cases, and if we go that way, then these queries need to be updated. I had just been imaging using ereport(ERROR, ...) which wouldn't have that problem. I think either approach would be an improvement over the status quo. -- Robert Haas EDB: http://www.enterprisedb.com