123456789101112
CREATE TABLE "tbl"( "id" bigint NOT NULL GENERATED ALWAYS AS IDENTITY, "user_id" bigint NOT NULL, "date" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,) PARTITION BY HASH (user_id);CREATE TABLE tbl_p01 PARTITION OF tbl FOR VALUES WITH (MODULUS 4, REMAINDER 0);CREATE TABLE tbl_p02 PARTITION OF tbl FOR VALUES WITH (MODULUS 4, REMAINDER 1);CREATE TABLE tbl_p03 PARTITION OF tbl FOR VALUES WITH (MODULUS 4, REMAINDER 2);CREATE TABLE tbl_p04 PARTITION OF tbl FOR VALUES WITH (MODULUS 4, REMAINDER 3);