mirror of https://github.com/citusdata/citus.git
Convert the function to a distributed function (#5596)
so that when metadata is synced, the table is on the workerpull/5584/head
parent
6d9218540b
commit
8007adda25
|
@ -70,6 +70,12 @@ CREATE OR REPLACE FUNCTION square(a INT) RETURNS INT AS $$
|
||||||
BEGIN
|
BEGIN
|
||||||
RETURN a*a;
|
RETURN a*a;
|
||||||
END; $$ LANGUAGE PLPGSQL STABLE;
|
END; $$ LANGUAGE PLPGSQL STABLE;
|
||||||
|
SELECT create_distributed_function('square(int)');
|
||||||
|
create_distributed_function
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
CREATE TABLE citus_local_table(a int, b int DEFAULT square(10));
|
CREATE TABLE citus_local_table(a int, b int DEFAULT square(10));
|
||||||
SELECT citus_add_local_table_to_metadata('citus_local_table');
|
SELECT citus_add_local_table_to_metadata('citus_local_table');
|
||||||
citus_add_local_table_to_metadata
|
citus_add_local_table_to_metadata
|
||||||
|
|
|
@ -278,8 +278,9 @@ test: foreign_key_to_reference_table
|
||||||
test: replicate_reference_tables_to_coordinator
|
test: replicate_reference_tables_to_coordinator
|
||||||
test: turn_mx_off
|
test: turn_mx_off
|
||||||
test: citus_local_tables
|
test: citus_local_tables
|
||||||
test: multi_row_router_insert mixed_relkind_tests
|
test: mixed_relkind_tests
|
||||||
test: turn_mx_on
|
test: turn_mx_on
|
||||||
|
test: multi_row_router_insert
|
||||||
test: multi_reference_table citus_local_tables_queries
|
test: multi_reference_table citus_local_tables_queries
|
||||||
test: citus_local_table_triggers
|
test: citus_local_table_triggers
|
||||||
test: coordinator_shouldhaveshards
|
test: coordinator_shouldhaveshards
|
||||||
|
|
|
@ -37,7 +37,7 @@ CREATE OR REPLACE FUNCTION square(a INT) RETURNS INT AS $$
|
||||||
BEGIN
|
BEGIN
|
||||||
RETURN a*a;
|
RETURN a*a;
|
||||||
END; $$ LANGUAGE PLPGSQL STABLE;
|
END; $$ LANGUAGE PLPGSQL STABLE;
|
||||||
|
SELECT create_distributed_function('square(int)');
|
||||||
CREATE TABLE citus_local_table(a int, b int DEFAULT square(10));
|
CREATE TABLE citus_local_table(a int, b int DEFAULT square(10));
|
||||||
SELECT citus_add_local_table_to_metadata('citus_local_table');
|
SELECT citus_add_local_table_to_metadata('citus_local_table');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue