BUG #15357: Data goes to wrong partition in HASH Partitioned table

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: jobin(dot)augustine(at)percona(dot)com
Subject: BUG #15357: Data goes to wrong partition in HASH Partitioned table
Date: 2018-08-28 15:28:50
Message-ID: 153547013018.1489.10425888757862385184@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 15357
Logged by: Jobin Augustine
Email address: jobin(dot)augustine(at)percona(dot)com
PostgreSQL version: 11beta3
Operating system: Linux (CentOS 7.4 64 bit)
Description:

Steps to reproduce
=============
Step 1. Create a hash partitioned table
postgres=# CREATE TABLE hash_parted (
postgres(# a int
postgres(# ) PARTITION BY HASH (a);
CREATE TABLE

Step 2. Create a partition which accpets rows with remainder 0 after a
modulus operation
postgres=# CREATE TABLE hpart_1 PARTITION OF hash_parted FOR VALUES WITH
(MODULUS 10, REMAINDER 0);
CREATE TABLE

Step 3. Try inserting a row which will have remainder 0 after modulus
operation
postgres=# insert into hash_parted values (10);
ERROR: no partition of relation "hash_parted" found for row
DETAIL: Partition key of the failing row contains (a) = (10).

FAILED!

Step 4. Create a partition which accepts the remainder 9 after modulo
operation
postgres=# CREATE TABLE hpart_10 PARTITION OF hash_parted FOR VALUES WITH
(MODULUS 10, REMAINDER 9);
CREATE TABLE

Step 5. Try inserting a value 10
postgres=# insert into hash_parted values (10);
INSERT 0 1

Data gets inserted into a partition which is supposed to accept reminder 9
after modulo operation.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Kukushkin 2018-08-28 15:32:44 Re: BUG #15346: Replica fails to start after the crash
Previous Message Kieran McCusker 2018-08-28 14:31:13 Re: BUG #15350: Getting invalid cache ID: 11 Errors