PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID15587
PG Version11.1
OSFedora 28
Opened2019-01-10 13:55:24+00
Reported byJesper Pedersen
StatusOpen

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      15587
Logged by:          Jesper Pedersen
Email address:      (redacted)
PostgreSQL version: 11.1
Operating system:   Fedora 28
Description:        

Hi,

The following works

CREATE TABLE t1 (i1 INT NOT NULL, i2 INT NOT NULL) PARTITION BY HASH (i1);

\o /dev/null
SELECT 'CREATE TABLE t1_p' || x::text || ' PARTITION OF t1
FOR VALUES WITH (MODULUS 64, REMAINDER ' || x::text || ');'
from generate_series(0,63) x;
\gexec
\o

ALTER TABLE ONLY t1 ADD CONSTRAINT uniq_t1_i1_i2 UNIQUE (i1, i2);

which gives

test=# \d+ t1
                              Partitioned table "public.t1"
 Column |  Type   | Collation | Nullable | Default | Storage | Stats target
| Description 
--------+---------+-----------+----------+---------+---------+--------------+-------------
 i1     | integer |           | not null |         | plain   |             
| 
 i2     | integer |           | not null |         | plain   |             
| 
Partition key: HASH (i1)
Indexes:
    "uniq_t1_i1_i2" UNIQUE CONSTRAINT, btree (i1, i2) INVALID


Removing ONLY from the ALTER command makes the index correct.

All branches.

Best regards,
 Jesper

Messages

DateAuthorSubject
2019-01-10 13:55:24+00=?utf-8?q?PG_Bug_reporting_form?=BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
2019-01-10 17:11:23+00Alvaro HerreraRe: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
2019-01-10 17:41:49+00Tom LaneRe: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
2019-01-10 17:43:11+00Jesper PedersenRe: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
2019-01-15 18:24:57+00Alvaro HerreraRe: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
2019-01-15 18:26:28+00Alvaro HerreraRe: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
2019-01-15 18:42:56+00Tom LaneRe: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
2019-01-15 19:35:32+00Alvaro HerreraRe: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
2019-01-15 19:45:03+00Jesper PedersenRe: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
2019-01-15 22:55:56+00Alvaro HerreraRe: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
2019-01-16 09:30:02+00Amit LangoteRe: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
2019-01-17 22:23:06+00Alvaro HerreraRe: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
2019-01-18 18:08:33+00Alvaro HerreraRe: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
2019-01-21 08:01:19+00Amit LangoteRe: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
2019-01-21 16:29:44+00Alvaro HerreraRe: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
2019-01-22 08:00:19+00Amit LangoteRe: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
2019-01-23 21:07:09+00Alvaro HerreraRe: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT
2019-01-24 01:59:22+00Amit LangoteRe: BUG #15587: Partitions with ALTER TABLE ADD CONSTRAINT