mirror of https://github.com/citusdata/citus.git
Address reviews except partition naming related ones
parent
8f179fbb83
commit
fa3f661421
|
@ -5,7 +5,7 @@ CREATE OR REPLACE FUNCTION pg_catalog.create_timeseries_table(
|
|||
premake_interval_count int DEFAULT NULL,
|
||||
start_from timestamptz DEFAULT NULL,
|
||||
compression_threshold INTERVAL DEFAULT NULL,
|
||||
retention_threshold INTERVAL DEFAULT NULL) -- can change the order with compression, raise a message about dropping data
|
||||
retention_threshold INTERVAL DEFAULT NULL)
|
||||
RETURNS void
|
||||
LANGUAGE C
|
||||
AS 'MODULE_PATHNAME', 'create_timeseries_table';
|
||||
|
@ -20,5 +20,3 @@ COMMENT ON FUNCTION pg_catalog.create_timeseries_table(
|
|||
compression_threshold INTERVAL,
|
||||
retention_threshold INTERVAL)
|
||||
IS 'creates a citus timeseries table which will be autopartitioned';
|
||||
|
||||
-- TODO: Add note about alter won't change existing tables
|
||||
|
|
|
@ -5,7 +5,7 @@ CREATE OR REPLACE FUNCTION pg_catalog.create_timeseries_table(
|
|||
premake_interval_count int DEFAULT NULL,
|
||||
start_from timestamptz DEFAULT NULL,
|
||||
compression_threshold INTERVAL DEFAULT NULL,
|
||||
retention_threshold INTERVAL DEFAULT NULL) -- can change the order with compression, raise a message about dropping data
|
||||
retention_threshold INTERVAL DEFAULT NULL)
|
||||
RETURNS void
|
||||
LANGUAGE C
|
||||
AS 'MODULE_PATHNAME', 'create_timeseries_table';
|
||||
|
|
|
@ -6,4 +6,4 @@ AS 'MODULE_PATHNAME', 'drop_timeseries_table_metadata';
|
|||
|
||||
COMMENT ON FUNCTION pg_catalog.drop_timeseries_table_metadata(
|
||||
logicalrelid regclass)
|
||||
IS 'drop a citus timeseries table''s metadata';
|
||||
IS 'drops citus timeseries table''s metadata';
|
||||
|
|
|
@ -4,8 +4,7 @@ CREATE OR REPLACE FUNCTION pg_catalog.get_missing_partition_ranges(
|
|||
start_from timestamptz DEFAULT NULL)
|
||||
returns table(
|
||||
range_from_value text,
|
||||
range_to_value text
|
||||
)
|
||||
range_to_value text)
|
||||
LANGUAGE plpgsql
|
||||
AS $$
|
||||
DECLARE
|
||||
|
@ -48,7 +47,8 @@ BEGIN
|
|||
INTO current_range_from_value, current_range_to_value
|
||||
FROM pg_catalog.time_partitions
|
||||
WHERE parent_table = table_name
|
||||
ORDER BY from_value::timestamptz;
|
||||
ORDER BY from_value::timestamptz ASC
|
||||
LIMIT 1;
|
||||
|
||||
WHILE current_range_from_value > start_from LOOP
|
||||
current_range_from_value := current_range_from_value - table_partition_interval;
|
||||
|
@ -92,7 +92,8 @@ BEGIN
|
|||
INTO current_range_from_value, current_range_to_value
|
||||
FROM pg_catalog.time_partitions
|
||||
WHERE parent_table = table_name
|
||||
ORDER BY from_value::timestamptz;
|
||||
ORDER BY from_value::timestamptz ASC
|
||||
LIMIT 1;
|
||||
END IF;
|
||||
|
||||
/*
|
||||
|
|
|
@ -4,8 +4,7 @@ CREATE OR REPLACE FUNCTION pg_catalog.get_missing_partition_ranges(
|
|||
start_from timestamptz DEFAULT NULL)
|
||||
returns table(
|
||||
range_from_value text,
|
||||
range_to_value text
|
||||
)
|
||||
range_to_value text)
|
||||
LANGUAGE plpgsql
|
||||
AS $$
|
||||
DECLARE
|
||||
|
@ -48,7 +47,8 @@ BEGIN
|
|||
INTO current_range_from_value, current_range_to_value
|
||||
FROM pg_catalog.time_partitions
|
||||
WHERE parent_table = table_name
|
||||
ORDER BY from_value::timestamptz;
|
||||
ORDER BY from_value::timestamptz ASC
|
||||
LIMIT 1;
|
||||
|
||||
WHILE current_range_from_value > start_from LOOP
|
||||
current_range_from_value := current_range_from_value - table_partition_interval;
|
||||
|
@ -92,7 +92,8 @@ BEGIN
|
|||
INTO current_range_from_value, current_range_to_value
|
||||
FROM pg_catalog.time_partitions
|
||||
WHERE parent_table = table_name
|
||||
ORDER BY from_value::timestamptz;
|
||||
ORDER BY from_value::timestamptz ASC
|
||||
LIMIT 1;
|
||||
END IF;
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue