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

From Ranier Vilela
Subject Re: Avoid possible dereference null pointer (src/backend/utils/cache/relcache.c)
Date
Msg-id CAEudQAqjQUh_gQz-=1Fx-TTFGs8SSajn+sjYOy0iac2fdRmYAQ@mail.gmail.com
Whole thread Raw
In response to Re: Avoid possible dereference null pointer (src/backend/utils/cache/relcache.c)  (Aleksander Alekseev <aleksander@timescale.com>)
List pgsql-hackers
Hi Aleksander.

Em ter., 17 de jun. de 2025 às 09:35, Aleksander Alekseev <aleksander@timescale.com> escreveu:
Hi,

> The function *ScanPgRelation* can return a invalid tuple.
> It is necessary to check the function's return,
> as is already done in other parts of the source.

Good find although I'm not certain if I agree with the patch.

We would be in serious trouble if RelationReloadNailed() could be
called for a non-existing relation. Wouldn't Assert() be more
appropriate?
IMO, I think no.

In all paths, this check is done, why would this be the only exception?

best regards,
Ranier Vilela

pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: BackendKeyData is mandatory?
Next
From: jian he
Date:
Subject: Re: wrong comments in rewriteTargetListIU