mirror of https://github.com/citusdata/citus.git
Fix function create-drop scripts
parent
d1f3f6e5e4
commit
4fe8ec3e61
|
@ -9,6 +9,7 @@
|
||||||
#include "udfs/citus_internal_add_object_metadata/11.0-1.sql"
|
#include "udfs/citus_internal_add_object_metadata/11.0-1.sql"
|
||||||
#include "udfs/citus_run_local_command/11.0-1.sql"
|
#include "udfs/citus_run_local_command/11.0-1.sql"
|
||||||
#include "udfs/worker_drop_sequence_dependency/11.0-1.sql"
|
#include "udfs/worker_drop_sequence_dependency/11.0-1.sql"
|
||||||
|
#include "udfs/worker_drop_distributed_table_only/11.0-1.sql"
|
||||||
|
|
||||||
|
|
||||||
DROP FUNCTION IF EXISTS pg_catalog.master_apply_delete_command(text);
|
DROP FUNCTION IF EXISTS pg_catalog.master_apply_delete_command(text);
|
||||||
|
@ -33,13 +34,6 @@ BEGIN
|
||||||
END;
|
END;
|
||||||
$$;
|
$$;
|
||||||
|
|
||||||
CREATE FUNCTION worker_drop_distributed_table_only(table_name text)
|
|
||||||
RETURNS VOID
|
|
||||||
LANGUAGE C STRICT
|
|
||||||
AS 'MODULE_PATHNAME', $$worker_drop_distributed_table_only$$;
|
|
||||||
COMMENT ON FUNCTION worker_drop_distributed_table_only(table_name text)
|
|
||||||
IS 'drop the distributed table only without the metadata';
|
|
||||||
|
|
||||||
-- Here we keep track of partitioned tables that exists before Citus 11
|
-- Here we keep track of partitioned tables that exists before Citus 11
|
||||||
-- where we need to call fix_all_partition_shard_index_names() before
|
-- where we need to call fix_all_partition_shard_index_names() before
|
||||||
-- metadata is synced. Note that after citus-11, we automatically
|
-- metadata is synced. Note that after citus-11, we automatically
|
||||||
|
|
|
@ -46,3 +46,4 @@ DROP FUNCTION pg_catalog.citus_check_cluster_node_health ();
|
||||||
DROP FUNCTION pg_catalog.citus_internal_add_object_metadata(text, text[], text[], integer, integer);
|
DROP FUNCTION pg_catalog.citus_internal_add_object_metadata(text, text[], text[], integer, integer);
|
||||||
DROP FUNCTION pg_catalog.citus_run_local_command(text);
|
DROP FUNCTION pg_catalog.citus_run_local_command(text);
|
||||||
DROP FUNCTION pg_catalog.worker_drop_sequence_dependency(text);
|
DROP FUNCTION pg_catalog.worker_drop_sequence_dependency(text);
|
||||||
|
DROP FUNCTION pg_catalog.worker_drop_distributed_table_only(table_name text);
|
||||||
|
|
7
src/backend/distributed/sql/udfs/worker_drop_distributed_table_only/11.0-1.sql
generated
Normal file
7
src/backend/distributed/sql/udfs/worker_drop_distributed_table_only/11.0-1.sql
generated
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
CREATE FUNCTION pg_catalog.worker_drop_distributed_table_only(table_name text)
|
||||||
|
RETURNS VOID
|
||||||
|
LANGUAGE C STRICT
|
||||||
|
AS 'MODULE_PATHNAME', $$worker_drop_distributed_table_only$$;
|
||||||
|
|
||||||
|
COMMENT ON FUNCTION worker_drop_distributed_table_only(table_name text)
|
||||||
|
IS 'drop the distributed table only without the metadata';
|
|
@ -0,0 +1,7 @@
|
||||||
|
CREATE FUNCTION pg_catalog.worker_drop_distributed_table_only(table_name text)
|
||||||
|
RETURNS VOID
|
||||||
|
LANGUAGE C STRICT
|
||||||
|
AS 'MODULE_PATHNAME', $$worker_drop_distributed_table_only$$;
|
||||||
|
|
||||||
|
COMMENT ON FUNCTION worker_drop_distributed_table_only(table_name text)
|
||||||
|
IS 'drop the distributed table only without the metadata';
|
|
@ -4304,7 +4304,7 @@ WHERE schemaname = 'partitioning_schema' AND tablename ilike '%part_table_with_%
|
||||||
SELECT citus_activate_node('localhost', :worker_1_port);
|
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||||
citus_activate_node
|
citus_activate_node
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1
|
16
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
|
|
|
@ -212,9 +212,11 @@ SELECT * FROM multi_extension.print_extension_changes();
|
||||||
ALTER EXTENSION citus UPDATE TO '9.5-1';
|
ALTER EXTENSION citus UPDATE TO '9.5-1';
|
||||||
|
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
SET citus.enable_object_propagation TO on;
|
||||||
SELECT master_add_node('localhost', :master_port, groupId=>0);
|
SELECT master_add_node('localhost', :master_port, groupId=>0);
|
||||||
CREATE TABLE citus_local_table (a int);
|
CREATE TABLE citus_local_table (a int);
|
||||||
SELECT create_citus_local_table('citus_local_table');
|
SELECT create_citus_local_table('citus_local_table');
|
||||||
|
RESET citus.enable_object_propagation;
|
||||||
|
|
||||||
-- downgrade from 9.5-1 to 9.4-1 should fail as we have a citus local table
|
-- downgrade from 9.5-1 to 9.4-1 should fail as we have a citus local table
|
||||||
ALTER EXTENSION citus UPDATE TO '9.4-1';
|
ALTER EXTENSION citus UPDATE TO '9.4-1';
|
||||||
|
@ -660,7 +662,6 @@ CREATE EXTENSION citus;
|
||||||
CREATE EXTENSION citus;
|
CREATE EXTENSION citus;
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
|
|
||||||
SET citus.enable_object_propagation TO off; -- prevent distributed transactions during add node
|
|
||||||
SELECT FROM master_add_node('localhost', :worker_1_port);
|
SELECT FROM master_add_node('localhost', :worker_1_port);
|
||||||
|
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
|
|
Loading…
Reference in New Issue