diff --git a/range.sql b/range.sql index 5af17014..680f4526 100644 --- a/range.sql +++ b/range.sql @@ -79,10 +79,6 @@ BEGIN EXECUTE pg_catalog.format('SELECT count(*), max(%s) FROM %s', expression, parent_relid) INTO rows_count, max_value; - IF rows_count = 0 THEN - RAISE EXCEPTION 'cannot determine partitions count for empty table'; - END IF; - p_count := 0; WHILE cur_value <= max_value LOOP @@ -172,10 +168,6 @@ BEGIN EXECUTE pg_catalog.format('SELECT count(*), max(%s) FROM %s', expression, parent_relid) INTO rows_count, max_value; - IF rows_count = 0 THEN - RAISE EXCEPTION 'cannot determine partitions count for empty table'; - END IF; - IF max_value IS NULL THEN RAISE EXCEPTION 'expression "%" can return NULL values', expression; END IF;