On Tue, May 16, 2017 at 10:00 PM, Dilip Kumar <dilipbal...@gmail.com> wrote: > On Tue, May 16, 2017 at 4:22 PM, amul sul <sula...@gmail.com> wrote: >> v6 patch has bug in partition oid mapping and indexing, fixed in the >> attached version. >> >> Now partition oids will be arranged in the ascending order of hash >> partition bound (i.e. modulus and remainder sorting order) > > Thanks for the update patch. I have some more comments. > > ------------ > + if (spec->remainder < 0) > + ereport(ERROR, > + (errcode(ERRCODE_INVALID_TABLE_DEFINITION), > + errmsg("hash partition remainder must be less than modulus"))); > > I think this error message is not correct, you might want to change it > to "hash partition remainder must be non-negative integer" >
Fixed in the attached version; used "hash partition remainder must be greater than or equal to 0" instead. > ------- > > + The table is partitioned by specifying remainder and modulus for > each > + partition. Each partition holds rows for which the hash value of > > Wouldn't it be better to say "modulus and remainder" instead of > "remainder and modulus" then it will be consistent? > You are correct, fixed in the attached version. > ------- > + An <command>UPDATE</> that causes a row to move from one partition to > + another fails, because > > fails, because -> fails because > This hunk is no longer exists in the attached patch, that was mistaken copied, sorry about that. > ------- > > Wouldn't it be a good idea to document how to increase the number of > hash partitions, I think we can document it somewhere with an example, > something like Robert explained upthread? > > create table foo (a integer, b text) partition by hash (a); > create table foo1 partition of foo with (modulus 2, remainder 0); > create table foo2 partition of foo with (modulus 2, remainder 1); > > You can detach foo1, create two new partitions with modulus 4 and > remainders 0 and 2, and move the data over from the old partition > > I think it will be good information for a user to have? or it's > already documented and I missed it? > I think, we should, but not sure about it. Regards, Amul
0001-Cleanup_v2.patch
Description: Binary data
0002-hash-partitioning_another_design-v8.patch
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers