pgsql: ATPrepAddPrimaryKey: ignore non-PK constraints

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: ATPrepAddPrimaryKey: ignore non-PK constraints
Date: 2023-09-01 12:23:39
Message-ID: E1qc3Ba-001xb3-Nx@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

ATPrepAddPrimaryKey: ignore non-PK constraints

Because of lack of test coverage, this function added by b0e96f311985
wasn't ignoring constraint types other than primary keys, which it
should have. Add some lines to a test for it.

Reported-by: Richard Guo <guofenglinux(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAMbWs48bc-k_-1fh0dZpAhp_LiR5MfEX9haystmoBboR_4czCQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e09d763e25dccc40695bc824ddda9abea791d66f

Modified Files
--------------
src/backend/commands/tablecmds.c | 12 +++++++++---
src/test/regress/expected/inherit.out | 25 ++++++++++++++++++++++++-
src/test/regress/sql/inherit.sql | 15 ++++++++++++++-
3 files changed, 47 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2023-09-01 17:50:31 pgsql: Fix not-null constraint test
Previous Message Bruce Momjian 2023-08-31 19:14:43 pgsql: doc: PG 16 relnotes: clarify LOCK TABLE description