Re: BUG #18345: Specifying index parameters for a PRIMARY KEY column constraint is a syntax error - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #18345: Specifying index parameters for a PRIMARY KEY column constraint is a syntax error
Date
Msg-id CAKFQuwaXCEdMCJAk7D+r7gCnNuYYntvyZsf+DcSi7Q4X10Mh3w@mail.gmail.com
Whole thread Raw
In response to BUG #18345: Specifying index parameters for a PRIMARY KEY column constraint is a syntax error  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs


On Thursday, February 15, 2024, PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      18345
Logged by:          Dylan Meysmans
Email address:      contact@mettekou.com
PostgreSQL version: 16.2
Operating system:   openSUSE Tumbleweed
Description:       

PostgreSQL 16.2 does not accept index parameters, such as an INCLUDE (...)
parameter, for a PRIMARY KEY column constraint in a CREATE TABLE DDL
statement. See https://dbfiddle.uk/6S1zwHRL for a minimal reproduction.
According to the documentation at
https://www.postgresql.org/docs/current/sql-createtable.html, this should be
allowed.


The syntax diagram has been generalized; you need to further consult the primary key description below that to see what specific combinations are valid.  In this case you need to use a table constraint with a named column list to add the include clause to primary key.

David J.

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #18345: Specifying index parameters for a PRIMARY KEY column constraint is a syntax error
Next
From: Tom Lane
Date:
Subject: Re: BUG #18343: Incorrect description in postgresql.conf for max_parallel_workers_per_gather