Re: var_is_nonnullable() fails to handle invalid NOT NULL constraints - Mailing list pgsql-hackers

From Richard Guo
Subject Re: var_is_nonnullable() fails to handle invalid NOT NULL constraints
Date
Msg-id CAMbWs48XfOUYPtVmW4ZFD6BfUch9zbWQNVkzNPX+cUe4zGvF=w@mail.gmail.com
Whole thread
In response to Re: var_is_nonnullable() fails to handle invalid NOT NULL constraints  (SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>)
List pgsql-hackers
On Sun, Apr 12, 2026 at 6:33 PM SATYANARAYANA NARLAPURAM
<satyanarlapuram@gmail.com> wrote:
> I tested this patch against the current HEAD (155c03ee) and it looks good.
> Build & tests: Applies cleanly, compiles without warnings, all 247 regression tests
> pass including the new subselect test case. Reproduced the bug before the patch
> and verified it is fixed after the patch.

Thanks for testing.

> Looks like it needs to perform table_open/table_close multiple times depending upon
> the number of output columns? I don't see it as a major concern but let others comment.

I don't see it as a major concern either performance-wise.  table_open
here is just a hash lookup and refcount increment, and table_close is
just a refcount decrement.  And the call only happens in NOT IN cases,
and only after sublink_testexpr_is_not_nullable has already returned
true.

So I've committed this patch.

- Richard



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [PATCH] Miscellaneous little fixes
Next
From: Haibo Yan
Date:
Subject: Re: Implement missing join selectivity estimation for range types