-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove redundant code for func epoch in create_partition_time
- Loading branch information
Showing
1 changed file
with
1 addition
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,8 +46,6 @@ v_sub_timestamp_max timestamptz; | |
v_sub_timestamp_min timestamptz; | ||
v_template_table text; | ||
v_time timestamptz; | ||
v_partition_id_start bigint; | ||
v_partition_id_end bigint; | ||
v_partition_text_start text; | ||
v_partition_text_end text; | ||
|
||
|
@@ -221,7 +219,7 @@ FOREACH v_time IN ARRAY p_partition_times LOOP | |
PERFORM @[email protected]_template_properties(p_parent_table, v_parent_schema, v_partition_name); | ||
END IF; | ||
|
||
IF v_epoch = 'none' THEN | ||
IF v_epoch IN ('none', 'func') THEN | ||
-- Attach with normal, time-based values for built-in constraint | ||
IF v_time_encoder IS NULL THEN | ||
EXECUTE format('ALTER TABLE %I.%I ATTACH PARTITION %I.%I FOR VALUES FROM (%L) TO (%L)' | ||
|
@@ -243,17 +241,6 @@ FOREACH v_time IN ARRAY p_partition_times LOOP | |
, v_partition_text_start | ||
, v_partition_text_end); | ||
END IF; | ||
ELSIF v_epoch = 'func' THEN | ||
EXECUTE format('SELECT %s(%L)', v_time_encoder, v_partition_timestamp_start) INTO v_partition_id_start; | ||
EXECUTE format('SELECT %s(%L)', v_time_encoder, v_partition_timestamp_end) INTO v_partition_id_end; | ||
|
||
EXECUTE format('ALTER TABLE %I.%I ATTACH PARTITION %I.%I FOR VALUES FROM (%L) TO (%L)' | ||
, v_parent_schema | ||
, v_parent_tablename | ||
, v_parent_schema | ||
, v_partition_name | ||
, v_partition_id_start | ||
, v_partition_id_end); | ||
ELSE | ||
-- Must attach with integer based values for built-in constraint and epoch | ||
IF v_epoch = 'seconds' THEN | ||
|