Re: Incorrect handling of IS [NOT] NULL quals on inheritance parents

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Richard Guo <guofenglinux(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Incorrect handling of IS [NOT] NULL quals on inheritance parents
Date: 2024-04-10 05:35:37
Message-ID: CAApHDvo9U51PK3YeNOPYOOVpfvZvBK-XABegueEH==2WoHwKiQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 10 Apr 2024 at 17:18, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> David Rowley <dgrowleyml(at)gmail(dot)com> writes:
> > I think a better fix is just to not apply the optimisation for
> > inheritance RTEs in add_base_clause_to_rel().
>
> Is it worth paying attention to whether the constraint is marked
> connoinherit? If that involves an extra syscache fetch, I'd tend to
> agree that it's not worth it; but if we can get that info for free
> it seems worthwhile to not break this for inheritance cases.

I think everything should be optimised as we like without that.
Effectively get_relation_info() looks at the pg_attribute.attnotnull
column for the relation in question. We never look at the
pg_constraint record to figure out the nullability of the column.

David

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2024-04-10 06:10:23 Re: Can't find not null constraint, but \d+ shows that
Previous Message Amit Kapila 2024-04-10 05:31:53 Re: Improve eviction algorithm in ReorderBuffer