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

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Incorrect handling of IS [NOT] NULL quals on inheritance parents
Дата
Msg-id CAApHDvo9U51PK3YeNOPYOOVpfvZvBK-XABegueEH==2WoHwKiQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Incorrect handling of IS [NOT] NULL quals on inheritance parents  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Wed, 10 Apr 2024 at 17:18, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> David Rowley <dgrowleyml@gmail.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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Improve eviction algorithm in ReorderBuffer
Следующее
От: jian he
Дата:
Сообщение: Re: Can't find not null constraint, but \d+ shows that