Re: BUG #19412: Wrong query result with not null constraint - Mailing list pgsql-bugs

From Artem Fadeev
Subject Re: BUG #19412: Wrong query result with not null constraint
Date
Msg-id 2b555957-2754-43ec-9b53-6dc7737f3135@postgrespro.ru
Whole thread Raw
In response to BUG #19412: Wrong query result with not null constraint  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
On 2/17/26 14:19, PG Bug reporting form wrote:
> The following bug has been logged on the website:
> 
> Bug reference:      19412
> Logged by:          Sergey Shinderuk
> Email address:      s.shinderuk@postgrespro.ru
> PostgreSQL version: 17.8
> Operating system:   Ubuntu 24.04
> Description:

git bisect shows the bug was introduced by commit 3af7040985b [0]

I suppose presence of UNION ALL subquery is important for the reproduction
because the commit uses RangeTblEntry->inh, which has the following remark
in the comment in src/include/nodes/parsenodes.h
        * inh is true for relation references that should be expanded to 
include
        * inheritance children, if the rel has any.  In the parser, this 
will
        * only be true for RTE_RELATION entries.  The planner also uses this
        * field to mark RTE_SUBQUERY entries that contain UNION ALL 
queries that
        * it has flattened into pulled-up subqueries (creating a 
structure much
        * like the effects of inheritance).


[0] 
https://github.com/postgres/postgres/commit/3af7040985b6df504a72cd307aad5d69ac5f5384

Regards,
Artem Fadeev.
https://postgrespro.com




pgsql-bugs by date:

Previous
From: Nazir Bilal Yavuz
Date:
Subject: Re: BUG #19095: Test if function exit() is used fail when linked static
Next
From: Tom Lane
Date:
Subject: Re: BUG #19411: libpq 16.x exhibits a memory leak when connections are repeatedly created and destroyed