From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix not-null constraint test
Date: Fri, 01 Sep 2023 17:50:31 +0000
Message-ID: <E1qc8Hv-00202s-5E@gemulon.postgresql.org> (raw)
Fix not-null constraint test
When a partitioned table has a primary key, trying to find the
corresponding not-null constraint for that column would come up empty,
causing code that's trying to check said not-null constraint to crash.
Fix by only running the check when the not-null constraint exists.
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://postgr.es/m/d57b4a69-7394-3146-5976-9a1ef27e7972@gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/d0ec2ddbe088f6da35444fad688a62eae4fbd840
Modified Files
--------------
src/backend/commands/tablecmds.c | 26 +++++++++++++++++++-------
src/test/regress/expected/constraints.out | 11 +++++++++++
src/test/regress/sql/constraints.sql | 11 +++++++++++
3 files changed, 41 insertions(+), 7 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: alvherre@alvh.no-ip.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix not-null constraint test
In-Reply-To: <E1qc8Hv-00202s-5E@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox