Re: amvalidate(): cache lookup failed for operator class 123 - Mailing list pgsql-hackers

From Robert Haas
Subject Re: amvalidate(): cache lookup failed for operator class 123
Date
Msg-id CA+TgmoanzpfAWZDfOipThh-LtCdzROmeE5Z8BFfvy6QFntsKNw@mail.gmail.com
Whole thread Raw
In response to Re: amvalidate(): cache lookup failed for operator class 123  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: amvalidate(): cache lookup failed for operator class 123
List pgsql-hackers
On Thu, May 13, 2021 at 4:49 PM Tom Lane <tgl@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



pgsql-hackers by date:

Previous
From: Ranier Vilela
Date:
Subject: Re: Possible memory corruption (src/timezone/zic.c b/src/timezone/zic.c)
Next
From: Julien Rouhaud
Date:
Subject: Re: compute_query_id and pg_stat_statements