maya
.public
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
ot_rw_monitor_partitions_alert(integer)
Parameters
Name
Type
Mode
min_premade_partitions
integer
IN
Definition
DECLARE current_date date; last_partition_date date; premade_partitions int; r record; BEGIN current_date := now()::date; select to_date(d,'______________YYYY_MM_DD') INTO last_partition_date FROM show_partitions('public.alert','DESC') d limit 1; premade_partitions := last_partition_date - current_date; IF premade_partitions >= min_premade_partitions THEN RETURN true; ELSE RETURN false; END IF; END;