Support for hash partitioning and tests for the same. Also, since update/delete on partitioned tables still depend on constraint exclusion for pruning, fix things such that get_relation_constraints includes partition constraints in its result only for non-select queries (for selects we have the new pruning code). Other bug fixes.
Hi Amit,
I have applied attached patch set on commit 11e264517dff7a911d9e6494de86049cab42cde3 and try to test for hash partition. I got a server crash with below test.
CREATE TABLE hp_tbl (a int, b int, c int) PARTITION BY HASH (a); CREATE TABLE hp_tbl_p1 PARTITION OF hp_tbl FOR VALUES WITH (modulus 4, remainder 0) PARTITION BY HASH (b); CREATE TABLE hp_tbl_p1_p1 PARTITION OF hp_tbl_p1 FOR VALUES WITH (modulus 4, remainder 0) PARTITION BY HASH (c); CREATE TABLE hp_tbl_p1_p1_p1 PARTITION OF hp_tbl_p1_p1 FOR VALUES WITH (modulus 4, remainder 0); CREATE TABLE hp_tbl_p2 PARTITION OF hp_tbl FOR VALUES WITH (modulus 4, remainder 1) PARTITION BY HASH (b); CREATE TABLE hp_tbl_p2_p1 PARTITION OF hp_tbl_p2 FOR VALUES WITH (modulus 4, remainder 1); CREATE TABLE hp_tbl_p2_p2 PARTITION OF hp_tbl_p2 FOR VALUES WITH (modulus 4, remainder 2); insert into hp_tbl select i,i,i from generate_series(0,10)i where i not in(2,4,6,7,10);
explain select * from hp_tbl where a = 2; server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: Failed. !>