Re: redundant check of msg in does_not_exist_skipping

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Japin Li <japinli(at)hotmail(dot)com>
Cc: Ted Yu <yuzhihong(at)gmail(dot)com>, peter(at)eisentraut(dot)org, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: redundant check of msg in does_not_exist_skipping
Date: 2022-11-17 15:55:47
Message-ID: 1833733.1668700547@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Japin Li <japinli(at)hotmail(dot)com> writes:
> On Thu, 17 Nov 2022 at 23:06, Japin Li <japinli(at)hotmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Himanshu Upadhyaya 2022-11-17 15:56:57 Re: HOT chain validation in verify_heapam()
Previous Message Tom Lane 2022-11-17 15:48:52 Re: allow segment size to be set to < 1GiB