Re: redundant check of msg in does_not_exist_skipping - Mailing list pgsql-hackers

From Tom Lane
Subject Re: redundant check of msg in does_not_exist_skipping
Date
Msg-id 1833733.1668700547@sss.pgh.pa.us
Whole thread Raw
In response to Re: redundant check of msg in does_not_exist_skipping  (Japin Li <japinli@hotmail.com>)
Responses Re: redundant check of msg in does_not_exist_skipping
List pgsql-hackers
Japin Li <japinli@hotmail.com> writes:
> On Thu, 17 Nov 2022 at 23:06, Japin Li <japinli@hotmail.com> wrote:
>> I think we cannot remove the check, for example, if objtype is OBJECT_OPFAMILY,
>> and schema_does_not_exist_skipping() returns true, the so the msg keeps NULL,
>> if we remove this check, a sigfault might be occurd in ereport().

> Sorry, I didn't look into schema_does_not_exist_skipping(), and after look
> into schema_does_not_exist_skipping function and others, all paths that go
> out switch branch has non-NULL for msg, so we can remove this check safely.

This is a completely bad idea.  If it takes that level of analysis
to see that msg can't be null, we should leave the test in place.
Any future modification of either this code or what it calls could
break the conclusion.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: allow segment size to be set to < 1GiB
Next
From: Himanshu Upadhyaya
Date:
Subject: Re: HOT chain validation in verify_heapam()