Re: BUG #19698: IMPORT FOREIGN SCHEMA treats a NOT VALID NOT NULL constraint as validated - Mailing list pgsql-bugs

From Andrey Borodin
Subject Re: BUG #19698: IMPORT FOREIGN SCHEMA treats a NOT VALID NOT NULL constraint as validated
Date
Msg-id D7AE90EA-0118-4661-BA72-41FFD7517064@yandex-team.ru
Whole thread
In response to Re: BUG #19698: IMPORT FOREIGN SCHEMA treats a NOT VALID NOT NULL constraint as validated  (Kirill Reshke <reshkekirill@gmail.com>)
Responses Re: BUG #19698: IMPORT FOREIGN SCHEMA treats a NOT VALID NOT NULL constraint as validated
List pgsql-bugs
On 18 Sep 2026, Kirill Reshke wrote:
> One simple fix can be simply importing NOT NULL NOT VALID as a
> nullable column, but this probably would make some people unhappy.

I support the simpler fix. Of the constraints the local planner could
use to infer properties of the remote rows, postgres_fdw imports only
NOT NULL. Importing only validated ones seems a reasonable policy.

This also needs fixing on older branches importing from a PG18+ server.
Could we adapt the query-result test from your second patch for the
first one?

Thank you!


Best regards, Andrey Borodin.




pgsql-bugs by date:

Previous
From: Andrey Borodin
Date:
Subject: Re: BUG #19700: PostgreSQL: an SP-GiST index on `inet` makes IPv6 rows invisible
Next
From: Tom Lane
Date:
Subject: Re: BUG #19710: Incorrect DELETE result after LEFT JOIN optimization