1,
create table partitioned
(
);
2,
create table p20090101 (
check(dt >= DATE ‘ 2009-01-01’ AND dt < DATE ‘2009-01-02’)
) inherits(partitioned);
create table p20090102 (
check(dt >= DATE ‘2009-01-02’ AND dt < DATE ‘2009-01-03’)
) inherits(partitioned);
3,
CREATE OR REPLACE RULE partitioned_p20090101 AS
ON INSERT TO partitioned WHERE
DO INSTEAD
NEW.a );
CREATE OR REPLACE RULE partitioned_p20090102 AS
ON INSERT TO partitioned WHERE
DO INSTEAD
NEW.a )
4,
SET constraint_exclusion = on;
评论