From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Disallow NO INHERIT not-null constraints on partitioned tables
Date: Thu, 02 May 2024 08:55:05 +0000
Message-ID: <E1s2SDY-0017p2-Io@gemulon.postgresql.org> (raw)
Disallow NO INHERIT not-null constraints on partitioned tables
Such constraints are semantically useless and only bring weird cases
along, so reject them.
As a side effect, we can no longer have "throwaway" constraints in
pg_dump for primary keys in partitioned tables, but since they don't
serve any useful purpose, we can just omit them.
Maybe this should be done for all types of constraints, but it's just
not-null ones that acquired this "ability" in the 17 timeframe, so for
the moment I'm not changing anything else.
Per note by Alexander Lakhin.
Discussion: https://postgr.es/m/7d923a66-55f0-3395-cd40-81c142b5448b@gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/13daa33fa5a6d340f9be280db14e7b07ed11f92e
Modified Files
--------------
src/backend/parser/parse_utilcmd.c | 10 ++++++++++
src/bin/pg_dump/pg_dump.c | 16 ++++++++++++++--
src/test/regress/expected/constraints.out | 5 +++++
src/test/regress/sql/constraints.sql | 4 ++++
4 files changed, 33 insertions(+), 2 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: Disallow NO INHERIT not-null constraints on partitioned tables
In-Reply-To: <E1s2SDY-0017p2-Io@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