From 5d7d83d6bbabee1551d4302c48b5de3cb45f80ff Mon Sep 17 00:00:00 2001 From: Oskari Saarenmaa Date: Tue, 5 Jul 2016 21:14:35 +0300 Subject: [PATCH] range.sql: drop redundant check for existing tables The check is always false as v_child_relname is schema-qualified while the comparison is to a plain table name. The entire check can be removed instead of fixing it as a few lines above we have a loop which comes up with a unique name. --- range.sql | 6 ------ 1 file changed, 6 deletions(-) diff --git a/range.sql b/range.sql index 91fdd260..860f2737 100644 --- a/range.sql +++ b/range.sql @@ -446,12 +446,6 @@ BEGIN EXIT WHEN v_child_relname_exists = 0; END LOOP; - /* Skip existing partitions */ - IF EXISTS (SELECT * FROM pg_tables WHERE tablename = v_child_relname) THEN - RAISE WARNING 'Relation % already exists, skipping...', v_child_relname; - RETURN NULL; - END IF; - EXECUTE format('CREATE TABLE %s (LIKE %s INCLUDING ALL)' , v_child_relname , p_parent);