Re: BUG #19698: IMPORT FOREIGN SCHEMA treats a NOT VALID NOT NULL constraint as validated

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: imchifan(at)163(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #19698: IMPORT FOREIGN SCHEMA treats a NOT VALID NOT NULL constraint as validated
Date: 2026-09-21 10:17:40
Message-ID: D7AE90EA-0118-4661-BA72-41FFD7517064@yandex-team.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2026-09-21 13:49:42 Re: BUG #19710: Incorrect DELETE result after LEFT JOIN optimization
Previous Message Andrey Borodin 2026-09-21 09:28:50 Re: BUG #19700: PostgreSQL: an SP-GiST index on `inet` makes IPv6 rows invisible