From dc45a7ebc45e18c63fd192eeeca6e55be3b0a300 Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Fri, 25 May 2012 13:58:46 +0300 Subject: [PATCH] public.create_partition: drop rule logic from here No point maintaing it in two places. Let the code stay as-is. --- sql/dispatch/create_partition.sql | 12 ------------ sql/dispatch/expected/test_create_part.out | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/sql/dispatch/create_partition.sql b/sql/dispatch/create_partition.sql index 771604e8..2a328b5d 100644 --- a/sql/dispatch/create_partition.sql +++ b/sql/dispatch/create_partition.sql @@ -125,18 +125,6 @@ begin execute sql; end loop; - -- copy rules - for r in - select rulename, definition, - substring(definition from ' TO (([a-z0-9._]+|"([^"]+|"")+")+)') as oldtbl - from pg_catalog.pg_rules - where schemaname = parent_schema - and tablename = parent_name - loop - sql := replace(r.definition, r.oldtbl, fq_part); - execute sql; - end loop; - return 1; end; $$ language plpgsql; diff --git a/sql/dispatch/expected/test_create_part.out b/sql/dispatch/expected/test_create_part.out index 637a893b..bbbd37c5 100644 --- a/sql/dispatch/expected/test_create_part.out +++ b/sql/dispatch/expected/test_create_part.out @@ -50,7 +50,7 @@ select count(*) from pg_constraint where conrelid = 'public.events_2011_01'::reg select count(*) from pg_rules where schemaname = 'public' and tablename = 'events_2011_01'; count ------- - 1 + 0 (1 row) -- \d events_2011_01 -- 2.39.5