BUG #18345: Specifying index parameters for a PRIMARY KEY column constraint is a syntax error

Started by PG Bug reporting formabout 2 years ago2 messagesbugs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

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.

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: PG Bug reporting form (#1)
Re: BUG #18345: Specifying index parameters for a PRIMARY KEY column constraint is a syntax error

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.