pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #15357: Data goes to wrong partition in HASH Partitioned table
2+ messages / 2 participants
[nested] [flat]
* BUG #15357: Data goes to wrong partition in HASH Partitioned table
@ 2018-08-28 15:28 PG Bug reporting form <noreply@postgresql.org>
0 siblings, 1 reply; 2+ messages in thread
From: PG Bug reporting form @ 2018-08-28 15:28 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: jobin.augustine@percona.com
The following bug has been logged on the website:
Bug reference: 15357
Logged by: Jobin Augustine
Email address: jobin.augustine@percona.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.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #15357: Data goes to wrong partition in HASH Partitioned table
@ 2018-08-28 15:40 Alvaro Herrera <alvherre@2ndquadrant.com>
parent: PG Bug reporting form <noreply@postgresql.org>
0 siblings, 0 replies; 2+ messages in thread
From: Alvaro Herrera @ 2018-08-28 15:40 UTC (permalink / raw)
To: jobin.augustine@percona.com; pgsql-bugs@lists.postgresql.org
On 2018-Aug-28, PG Bug reporting form wrote:
> 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!
The hash function for integers does not return the input integer,
therefore the modulus is not that of the integer value. This is not a
bug.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2018-08-28 15:40 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-08-28 15:28 BUG #15357: Data goes to wrong partition in HASH Partitioned table PG Bug reporting form <noreply@postgresql.org>
2018-08-28 15:40 ` Alvaro Herrera <alvherre@2ndquadrant.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox