Table partition with primary key in 11.3

From: User <ya(at)penek(dot)org>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Table partition with primary key in 11.3
Date: 2019-05-22 17:46:39
Message-ID: 94935ac5-2f65-3c41-c14d-1b13da8e19ca@penek.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

CREATE TABLE public.test1 (
x1 integer NOT NULL,
x2 integer NOT NULL,
CONSTRAINT test1_pkey PRIMARY KEY (x1) INCLUDE(x2)
) PARTITION BY RANGE (x2);

This query works in 11.1 but fails in 11.3 with messages:

ERROR: insufficient columns in PRIMARY KEY constraint definition
DETAIL: PRIMARY KEY constraint on table "test1" lacks column "x2" which
is part of the partition key.
SQL state: 0A000

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2019-05-22 17:53:18 Re: Bulk inserts into two (related) tables
Previous Message Jeremy Finzel 2019-05-22 17:22:46 Re: Bulk inserts into two (related) tables