Re: BUG #15357: Data goes to wrong partition in HASH Partitionedtable - Mailing list pgsql-bugs

From Alvaro Herrera
Subject Re: BUG #15357: Data goes to wrong partition in HASH Partitionedtable
Date
Msg-id 20180828154057.ul5t2k4lzo7zmkjv@alvherre.pgsql
Whole thread Raw
In response to BUG #15357: Data goes to wrong partition in HASH Partitioned table  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
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


pgsql-bugs by date:

Previous
From: Alexander Kukushkin
Date:
Subject: Re: BUG #15346: Replica fails to start after the crash
Next
From: Dean Rasheed
Date:
Subject: Re: BUG #15307: Low numerical precision of (Co-) Variance