mirror of https://github.com/citusdata/citus.git
Rename drop function to drop_timeseries_table_metadata
parent
acc787fac3
commit
8f179fbb83
|
@ -19,6 +19,6 @@ ALTER TABLE pg_catalog.pg_dist_placement ADD CONSTRAINT placement_shardid_groupi
|
|||
#include "udfs/citus_drop_trigger/10.2-1.sql"
|
||||
#include "../../timeseries/sql/timeseries--10.1-1--10.2-1.sql"
|
||||
#include "../../timeseries/sql/udfs/create_timeseries_table/10.2-1.sql"
|
||||
#include "../../timeseries/sql/udfs/drop_timeseries_table/10.2-1.sql"
|
||||
#include "../../timeseries/sql/udfs/drop_timeseries_table_metadata/10.2-1.sql"
|
||||
#include "../../timeseries/sql/udfs/create_missing_partitions/10.2-1.sql"
|
||||
#include "../../timeseries/sql/udfs/get_missing_partition_ranges/10.2-1.sql"
|
||||
|
|
|
@ -24,7 +24,7 @@ BEGIN
|
|||
PERFORM master_remove_distributed_table_metadata_from_workers(v_obj.objid, v_obj.schema_name, v_obj.object_name);
|
||||
PERFORM citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name);
|
||||
PERFORM master_remove_partition_metadata(v_obj.objid, v_obj.schema_name, v_obj.object_name);
|
||||
PERFORM drop_timeseries_table(v_obj.objid);
|
||||
PERFORM drop_timeseries_table_metadata(v_obj.objid);
|
||||
END LOOP;
|
||||
|
||||
-- remove entries from citus.pg_dist_object for all dropped root (objsubid = 0) objects
|
||||
|
|
|
@ -24,7 +24,7 @@ BEGIN
|
|||
PERFORM master_remove_distributed_table_metadata_from_workers(v_obj.objid, v_obj.schema_name, v_obj.object_name);
|
||||
PERFORM citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name);
|
||||
PERFORM master_remove_partition_metadata(v_obj.objid, v_obj.schema_name, v_obj.object_name);
|
||||
PERFORM drop_timeseries_table(v_obj.objid);
|
||||
PERFORM drop_timeseries_table_metadata(v_obj.objid);
|
||||
END LOOP;
|
||||
|
||||
-- remove entries from citus.pg_dist_object for all dropped root (objsubid = 0) objects
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* drop_timeseries_table.c
|
||||
* drop_timeseries_table_metadata.c
|
||||
* Routines related to the drop of timeseries tables.
|
||||
*
|
||||
* Copyright (c) Citus Data, Inc.
|
||||
|
@ -23,17 +23,17 @@
|
|||
#include "distributed/metadata_cache.h"
|
||||
#include "timeseries/timeseries_utils.h"
|
||||
|
||||
PG_FUNCTION_INFO_V1(drop_timeseries_table);
|
||||
PG_FUNCTION_INFO_V1(drop_timeseries_table_metadata);
|
||||
|
||||
/*
|
||||
* drop_timeseries_table gets the table oid, then it drops
|
||||
* drop_timeseries_table_metadata gets the table oid, then it drops
|
||||
* all the metadata related to it. Note that this function doesn't
|
||||
* drop any partitions or any data of the given table.
|
||||
*
|
||||
* TODO: Add unscheduling for automated jobs as well.
|
||||
*/
|
||||
Datum
|
||||
drop_timeseries_table(PG_FUNCTION_ARGS)
|
||||
drop_timeseries_table_metadata(PG_FUNCTION_ARGS)
|
||||
{
|
||||
CheckCitusVersion(ERROR);
|
||||
|
|
@ -4,15 +4,15 @@ DROP FUNCTION pg_catalog.create_missing_partitions(regclass,timestamp with time
|
|||
DROP FUNCTION pg_catalog.create_timeseries_table(regclass,interval,integer,integer,timestamp with time zone,interval,interval);
|
||||
DROP FUNCTION pg_catalog.get_missing_partition_ranges(regclass,timestamp with time zone,timestamp with time zone);
|
||||
|
||||
-- In Citus 10.2, we added another internal udf (drop_timeseries_table)
|
||||
-- In Citus 10.2, we added another internal udf (drop_timeseries_table_metadata)
|
||||
-- to be called by citus_drop_trigger. Since this script is executed when
|
||||
-- downgrading Citus, we don't have drop_timeseries_table in citus.so.
|
||||
-- downgrading Citus, we don't have drop_timeseries_table_metadata in citus.so.
|
||||
-- For this reason, we first need to downgrade citus_drop_trigger so it doesn't
|
||||
-- call drop_timeseries_table.
|
||||
-- call drop_timeseries_table_metadata.
|
||||
#include "../../../distributed/sql/udfs/citus_drop_trigger/10.0-1.sql"
|
||||
|
||||
-- Now we can safely drop drop_timeseries_table as we downgraded citus_drop_trigger.
|
||||
DROP FUNCTION pg_catalog.drop_timeseries_table(regclass);
|
||||
-- Now we can safely drop drop_timeseries_table_metadata as we downgraded citus_drop_trigger.
|
||||
DROP FUNCTION pg_catalog.drop_timeseries_table_metadata(regclass);
|
||||
DROP TABLE tables;
|
||||
|
||||
RESET search_path;
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
CREATE OR REPLACE FUNCTION pg_catalog.drop_timeseries_table(
|
||||
logicalrelid regclass)
|
||||
RETURNS void
|
||||
LANGUAGE C
|
||||
AS 'MODULE_PATHNAME', 'drop_timeseries_table';
|
||||
|
||||
COMMENT ON FUNCTION pg_catalog.drop_timeseries_table(
|
||||
logicalrelid regclass)
|
||||
IS 'drops a citus timeseries table by removing metadata';
|
||||
-- TODO: Update comment for unscheduling
|
|
@ -1,9 +0,0 @@
|
|||
CREATE OR REPLACE FUNCTION pg_catalog.drop_timeseries_table(
|
||||
logicalrelid regclass)
|
||||
RETURNS void
|
||||
LANGUAGE C
|
||||
AS 'MODULE_PATHNAME', 'drop_timeseries_table';
|
||||
|
||||
COMMENT ON FUNCTION pg_catalog.drop_timeseries_table(
|
||||
logicalrelid regclass)
|
||||
IS 'drops a citus timeseries table by removing metadata';
|
|
@ -0,0 +1,9 @@
|
|||
CREATE OR REPLACE FUNCTION pg_catalog.drop_timeseries_table_metadata(
|
||||
logicalrelid regclass)
|
||||
RETURNS void
|
||||
LANGUAGE C
|
||||
AS 'MODULE_PATHNAME', 'drop_timeseries_table_metadata';
|
||||
|
||||
COMMENT ON FUNCTION pg_catalog.drop_timeseries_table_metadata(
|
||||
logicalrelid regclass)
|
||||
IS 'drops citus timeseries table''s metadata';
|
|
@ -0,0 +1,9 @@
|
|||
CREATE OR REPLACE FUNCTION pg_catalog.drop_timeseries_table_metadata(
|
||||
logicalrelid regclass)
|
||||
RETURNS void
|
||||
LANGUAGE C
|
||||
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';
|
|
@ -806,7 +806,7 @@ SELECT * FROM multi_extension.print_extension_changes();
|
|||
| function citus_internal_update_relation_colocation(oid,integer) void
|
||||
| function create_missing_partitions(regclass,timestamp with time zone,timestamp with time zone) boolean
|
||||
| function create_timeseries_table(regclass,interval,integer,integer,timestamp with time zone,interval,interval) void
|
||||
| function drop_timeseries_table(regclass) void
|
||||
| function drop_timeseries_table_metadata(regclass) void
|
||||
| function get_missing_partition_ranges(regclass,timestamp with time zone,timestamp with time zone) TABLE(range_from_value text, range_to_value text)
|
||||
| function stop_metadata_sync_to_node(text,integer,boolean) void
|
||||
| schema timeseries
|
||||
|
|
|
@ -120,7 +120,7 @@ ORDER BY 1;
|
|||
function create_reference_table(regclass)
|
||||
function create_timeseries_table(regclass,interval,integer,integer,timestamp with time zone,interval,interval)
|
||||
function distributed_tables_colocated(regclass,regclass)
|
||||
function drop_timeseries_table(regclass)
|
||||
function drop_timeseries_table_metadata(regclass)
|
||||
function dump_global_wait_edges()
|
||||
function dump_local_wait_edges()
|
||||
function fetch_intermediate_results(text[],text,integer)
|
||||
|
|
Loading…
Reference in New Issue