Re: Avoid possible dereference null pointer (src/backend/utils/cache/relcache.c) - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Avoid possible dereference null pointer (src/backend/utils/cache/relcache.c)
Date
Msg-id 158F1477-700B-4C05-954B-78FE5A4BA759@yesql.se
Whole thread Raw
In response to Re: Avoid possible dereference null pointer (src/backend/utils/cache/relcache.c)  (Tomas Vondra <tomas@vondra.me>)
List pgsql-hackers
> On 17 Jun 2025, at 15:43, Tomas Vondra <tomas@vondra.me> wrote:

> .. if we
> get a failure here, it's not clear to me we can really keep the system
> running anyway. It's not just the usual "relcache miss" and if the user
> retries it will probably work fine. The catalog is borked, and who knows
> in what way.

Agreed.

> My opinion is that adding a "elog(ERROR)" here would be misleading, as
> it implies it's something we expect. And mostly pointless. I can imagine
> adding an Assert, but I don't quite see how is that better than just
> hitting a segfault a couple lines later.

If I break something here while hacking I'd probably prefer a segfault to an
Assert.

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: Konstantin Knizhnik
Date:
Subject: Re: Non-reproducible AIO failure
Next
From: Alexander Korotkov
Date:
Subject: Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly