Thread: BUG #18345: Specifying index parameters for a PRIMARY KEY column constraint is a syntax error
BUG #18345: Specifying index parameters for a PRIMARY KEY column constraint is a syntax error
From
PG Bug reporting form
Date:
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.
Re: BUG #18345: Specifying index parameters for a PRIMARY KEY column constraint is a syntax error
From
"David G. Johnston"
Date:
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.