We don't do just id % 3, we calculate some hash value from partition key (id) and route the tuple according this hash
value.Such condition for your example:
select *, satisfies_hash_partition('myschema.customers'::regclass, 3, 0, id) as modulus3_remainder0_target_partition
frommyschema.cust0;
Can't illustrate more at the SQL level due to the lack of a uint64 calculations. At C level we are here:
https://github.com/postgres/postgres/blob/REL_13_STABLE/src/backend/partitioning/partbounds.c#L4595
regards, Sergei