|
|
|
@ -644,7 +644,7 @@ CREATE OR REPLACE PROCEDURE only_local_execution_with_params(int) AS $$
|
|
|
|
|
END;
|
|
|
|
|
$$ LANGUAGE plpgsql;
|
|
|
|
|
CALL only_local_execution_with_params(1);
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES ($1, '11'::text, 21) ON CONFLICT(key) DO UPDATE SET value = '29'::text
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (1, '11'::text, '21'::bigint) ON CONFLICT(key) DO UPDATE SET value = '29'::text
|
|
|
|
|
CONTEXT: SQL statement "INSERT INTO distributed_table VALUES ($1, '11',21) ON CONFLICT(key) DO UPDATE SET value = '29'"
|
|
|
|
|
PL/pgSQL function only_local_execution_with_params(integer) line 4 at SQL statement
|
|
|
|
|
LOG: executing the command locally: SELECT count(*) AS count FROM local_shard_execution.distributed_table_1470001 distributed_table WHERE (key OPERATOR(pg_catalog.=) 1)
|
|
|
|
@ -905,6 +905,163 @@ LOG: executing the command locally: SELECT count(*) AS count FROM local_shard_e
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
|
PREPARE local_insert_prepare_no_param AS INSERT INTO distributed_table VALUES (1+0*random(), '11',21::int) ON CONFLICT(key) DO UPDATE SET value = '29' || '28' RETURNING *, key + 1, value || '30', age * 15;
|
|
|
|
|
PREPARE local_insert_prepare_param (int) AS INSERT INTO distributed_table VALUES ($1+0*random(), '11',21::int) ON CONFLICT(key) DO UPDATE SET value = '29' || '28' RETURNING *, key + 1, value || '30', age * 15;
|
|
|
|
|
BEGIN;
|
|
|
|
|
-- 6 local execution without params
|
|
|
|
|
EXECUTE local_insert_prepare_no_param;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (1, '11'::text, '21'::bigint) ON CONFLICT(key) DO UPDATE SET value = '2928'::text RETURNING citus_table_alias.key, citus_table_alias.value, citus_table_alias.age, (citus_table_alias.key OPERATOR(pg_catalog.+) 1), (citus_table_alias.value OPERATOR(pg_catalog.||) '30'::text), (citus_table_alias.age OPERATOR(pg_catalog.*) 15)
|
|
|
|
|
key | value | age | ?column? | ?column? | ?column?
|
|
|
|
|
-----+-------+-----+----------+----------+----------
|
|
|
|
|
1 | 2928 | 21 | 2 | 292830 | 315
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE local_insert_prepare_no_param;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (1, '11'::text, '21'::bigint) ON CONFLICT(key) DO UPDATE SET value = '2928'::text RETURNING citus_table_alias.key, citus_table_alias.value, citus_table_alias.age, (citus_table_alias.key OPERATOR(pg_catalog.+) 1), (citus_table_alias.value OPERATOR(pg_catalog.||) '30'::text), (citus_table_alias.age OPERATOR(pg_catalog.*) 15)
|
|
|
|
|
key | value | age | ?column? | ?column? | ?column?
|
|
|
|
|
-----+-------+-----+----------+----------+----------
|
|
|
|
|
1 | 2928 | 21 | 2 | 292830 | 315
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE local_insert_prepare_no_param;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (1, '11'::text, '21'::bigint) ON CONFLICT(key) DO UPDATE SET value = '2928'::text RETURNING citus_table_alias.key, citus_table_alias.value, citus_table_alias.age, (citus_table_alias.key OPERATOR(pg_catalog.+) 1), (citus_table_alias.value OPERATOR(pg_catalog.||) '30'::text), (citus_table_alias.age OPERATOR(pg_catalog.*) 15)
|
|
|
|
|
key | value | age | ?column? | ?column? | ?column?
|
|
|
|
|
-----+-------+-----+----------+----------+----------
|
|
|
|
|
1 | 2928 | 21 | 2 | 292830 | 315
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE local_insert_prepare_no_param;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (1, '11'::text, '21'::bigint) ON CONFLICT(key) DO UPDATE SET value = '2928'::text RETURNING citus_table_alias.key, citus_table_alias.value, citus_table_alias.age, (citus_table_alias.key OPERATOR(pg_catalog.+) 1), (citus_table_alias.value OPERATOR(pg_catalog.||) '30'::text), (citus_table_alias.age OPERATOR(pg_catalog.*) 15)
|
|
|
|
|
key | value | age | ?column? | ?column? | ?column?
|
|
|
|
|
-----+-------+-----+----------+----------+----------
|
|
|
|
|
1 | 2928 | 21 | 2 | 292830 | 315
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE local_insert_prepare_no_param;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (1, '11'::text, '21'::bigint) ON CONFLICT(key) DO UPDATE SET value = '2928'::text RETURNING citus_table_alias.key, citus_table_alias.value, citus_table_alias.age, (citus_table_alias.key OPERATOR(pg_catalog.+) 1), (citus_table_alias.value OPERATOR(pg_catalog.||) '30'::text), (citus_table_alias.age OPERATOR(pg_catalog.*) 15)
|
|
|
|
|
key | value | age | ?column? | ?column? | ?column?
|
|
|
|
|
-----+-------+-----+----------+----------+----------
|
|
|
|
|
1 | 2928 | 21 | 2 | 292830 | 315
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE local_insert_prepare_no_param;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (1, '11'::text, '21'::bigint) ON CONFLICT(key) DO UPDATE SET value = '2928'::text RETURNING citus_table_alias.key, citus_table_alias.value, citus_table_alias.age, (citus_table_alias.key OPERATOR(pg_catalog.+) 1), (citus_table_alias.value OPERATOR(pg_catalog.||) '30'::text), (citus_table_alias.age OPERATOR(pg_catalog.*) 15)
|
|
|
|
|
key | value | age | ?column? | ?column? | ?column?
|
|
|
|
|
-----+-------+-----+----------+----------+----------
|
|
|
|
|
1 | 2928 | 21 | 2 | 292830 | 315
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
-- 6 local executions with params
|
|
|
|
|
EXECUTE local_insert_prepare_param(1);
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (1, '11'::text, '21'::bigint) ON CONFLICT(key) DO UPDATE SET value = '2928'::text RETURNING citus_table_alias.key, citus_table_alias.value, citus_table_alias.age, (citus_table_alias.key OPERATOR(pg_catalog.+) 1), (citus_table_alias.value OPERATOR(pg_catalog.||) '30'::text), (citus_table_alias.age OPERATOR(pg_catalog.*) 15)
|
|
|
|
|
key | value | age | ?column? | ?column? | ?column?
|
|
|
|
|
-----+-------+-----+----------+----------+----------
|
|
|
|
|
1 | 2928 | 21 | 2 | 292830 | 315
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE local_insert_prepare_param(5);
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (5, '11'::text, '21'::bigint) ON CONFLICT(key) DO UPDATE SET value = '2928'::text RETURNING citus_table_alias.key, citus_table_alias.value, citus_table_alias.age, (citus_table_alias.key OPERATOR(pg_catalog.+) 1), (citus_table_alias.value OPERATOR(pg_catalog.||) '30'::text), (citus_table_alias.age OPERATOR(pg_catalog.*) 15)
|
|
|
|
|
key | value | age | ?column? | ?column? | ?column?
|
|
|
|
|
-----+-------+-----+----------+----------+----------
|
|
|
|
|
5 | 2928 | 22 | 6 | 292830 | 330
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE local_insert_prepare_param(6);
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470003 AS citus_table_alias (key, value, age) VALUES (6, '11'::text, '21'::bigint) ON CONFLICT(key) DO UPDATE SET value = '2928'::text RETURNING citus_table_alias.key, citus_table_alias.value, citus_table_alias.age, (citus_table_alias.key OPERATOR(pg_catalog.+) 1), (citus_table_alias.value OPERATOR(pg_catalog.||) '30'::text), (citus_table_alias.age OPERATOR(pg_catalog.*) 15)
|
|
|
|
|
key | value | age | ?column? | ?column? | ?column?
|
|
|
|
|
-----+-------+-----+----------+----------+----------
|
|
|
|
|
6 | 11 | 21 | 7 | 1130 | 315
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE local_insert_prepare_param(1);
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (1, '11'::text, '21'::bigint) ON CONFLICT(key) DO UPDATE SET value = '2928'::text RETURNING citus_table_alias.key, citus_table_alias.value, citus_table_alias.age, (citus_table_alias.key OPERATOR(pg_catalog.+) 1), (citus_table_alias.value OPERATOR(pg_catalog.||) '30'::text), (citus_table_alias.age OPERATOR(pg_catalog.*) 15)
|
|
|
|
|
key | value | age | ?column? | ?column? | ?column?
|
|
|
|
|
-----+-------+-----+----------+----------+----------
|
|
|
|
|
1 | 2928 | 21 | 2 | 292830 | 315
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE local_insert_prepare_param(5);
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (5, '11'::text, '21'::bigint) ON CONFLICT(key) DO UPDATE SET value = '2928'::text RETURNING citus_table_alias.key, citus_table_alias.value, citus_table_alias.age, (citus_table_alias.key OPERATOR(pg_catalog.+) 1), (citus_table_alias.value OPERATOR(pg_catalog.||) '30'::text), (citus_table_alias.age OPERATOR(pg_catalog.*) 15)
|
|
|
|
|
key | value | age | ?column? | ?column? | ?column?
|
|
|
|
|
-----+-------+-----+----------+----------+----------
|
|
|
|
|
5 | 2928 | 22 | 6 | 292830 | 330
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE local_insert_prepare_param(6);
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470003 AS citus_table_alias (key, value, age) VALUES (6, '11'::text, '21'::bigint) ON CONFLICT(key) DO UPDATE SET value = '2928'::text RETURNING citus_table_alias.key, citus_table_alias.value, citus_table_alias.age, (citus_table_alias.key OPERATOR(pg_catalog.+) 1), (citus_table_alias.value OPERATOR(pg_catalog.||) '30'::text), (citus_table_alias.age OPERATOR(pg_catalog.*) 15)
|
|
|
|
|
key | value | age | ?column? | ?column? | ?column?
|
|
|
|
|
-----+-------+-----+----------+----------+----------
|
|
|
|
|
6 | 2928 | 21 | 7 | 292830 | 315
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
-- followed by a non-local execution
|
|
|
|
|
EXECUTE remote_prepare_param(2);
|
|
|
|
|
LOG: executing the command locally: SELECT count(*) AS count FROM local_shard_execution.distributed_table_1470001 distributed_table WHERE (key OPERATOR(pg_catalog.<>) 2)
|
|
|
|
|
LOG: executing the command locally: SELECT count(*) AS count FROM local_shard_execution.distributed_table_1470003 distributed_table WHERE (key OPERATOR(pg_catalog.<>) 2)
|
|
|
|
|
count
|
|
|
|
|
-------
|
|
|
|
|
5
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
|
PREPARE local_multi_row_insert_prepare_no_param AS
|
|
|
|
|
INSERT INTO distributed_table VALUES (1,'55', 21), (5,'15',33) ON CONFLICT (key) WHERE key > 3 and key < 4 DO UPDATE SET value = '88' || EXCLUDED.value;
|
|
|
|
|
PREPARE local_multi_row_insert_prepare_no_param_multi_shard AS
|
|
|
|
|
INSERT INTO distributed_table VALUES (6,'55', 21), (5,'15',33) ON CONFLICT (key) WHERE key > 3 AND key < 4 DO UPDATE SET value = '88' || EXCLUDED.value;;
|
|
|
|
|
PREPARE local_multi_row_insert_prepare_params(int,int) AS
|
|
|
|
|
INSERT INTO distributed_table VALUES ($1,'55', 21), ($2,'15',33) ON CONFLICT (key) WHERE key > 3 and key < 4 DO UPDATE SET value = '88' || EXCLUDED.value;;
|
|
|
|
|
INSERT INTO reference_table VALUES (11);
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.reference_table_1470000 (key) VALUES (11)
|
|
|
|
|
BEGIN;
|
|
|
|
|
EXECUTE local_multi_row_insert_prepare_no_param;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (1,'55'::text,'21'::bigint), (5,'15'::text,'33'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
EXECUTE local_multi_row_insert_prepare_no_param;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (1,'55'::text,'21'::bigint), (5,'15'::text,'33'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
EXECUTE local_multi_row_insert_prepare_no_param;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (1,'55'::text,'21'::bigint), (5,'15'::text,'33'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
EXECUTE local_multi_row_insert_prepare_no_param;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (1,'55'::text,'21'::bigint), (5,'15'::text,'33'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
EXECUTE local_multi_row_insert_prepare_no_param;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (1,'55'::text,'21'::bigint), (5,'15'::text,'33'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
EXECUTE local_multi_row_insert_prepare_no_param;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (1,'55'::text,'21'::bigint), (5,'15'::text,'33'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
EXECUTE local_multi_row_insert_prepare_no_param_multi_shard;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (5,'15'::text,'33'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470003 AS citus_table_alias (key, value, age) VALUES (6,'55'::text,'21'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
EXECUTE local_multi_row_insert_prepare_no_param_multi_shard;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (5,'15'::text,'33'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470003 AS citus_table_alias (key, value, age) VALUES (6,'55'::text,'21'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
EXECUTE local_multi_row_insert_prepare_no_param_multi_shard;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (5,'15'::text,'33'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470003 AS citus_table_alias (key, value, age) VALUES (6,'55'::text,'21'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
EXECUTE local_multi_row_insert_prepare_no_param_multi_shard;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (5,'15'::text,'33'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470003 AS citus_table_alias (key, value, age) VALUES (6,'55'::text,'21'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
EXECUTE local_multi_row_insert_prepare_no_param_multi_shard;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (5,'15'::text,'33'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470003 AS citus_table_alias (key, value, age) VALUES (6,'55'::text,'21'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
EXECUTE local_multi_row_insert_prepare_no_param_multi_shard;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (5,'15'::text,'33'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470003 AS citus_table_alias (key, value, age) VALUES (6,'55'::text,'21'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
EXECUTE local_multi_row_insert_prepare_params(1,6);
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (1,'55'::text,'21'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470003 AS citus_table_alias (key, value, age) VALUES (6,'15'::text,'33'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
EXECUTE local_multi_row_insert_prepare_params(1,5);
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (1,'55'::text,'21'::bigint), (5,'15'::text,'33'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
EXECUTE local_multi_row_insert_prepare_params(6,5);
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (5,'15'::text,'33'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470003 AS citus_table_alias (key, value, age) VALUES (6,'55'::text,'21'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
EXECUTE local_multi_row_insert_prepare_params(5,1);
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (5,'55'::text,'21'::bigint), (1,'15'::text,'33'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
EXECUTE local_multi_row_insert_prepare_params(5,6);
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (5,'55'::text,'21'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470003 AS citus_table_alias (key, value, age) VALUES (6,'15'::text,'33'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
EXECUTE local_multi_row_insert_prepare_params(5,1);
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (5,'55'::text,'21'::bigint), (1,'15'::text,'33'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
-- one task is remote
|
|
|
|
|
EXECUTE local_multi_row_insert_prepare_params(5,11);
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.distributed_table_1470001 AS citus_table_alias (key, value, age) VALUES (5,'55'::text,'21'::bigint) ON CONFLICT(key) WHERE ((key OPERATOR(pg_catalog.>) 3) AND (key OPERATOR(pg_catalog.<) 4)) DO UPDATE SET value = ('88'::text OPERATOR(pg_catalog.||) excluded.value)
|
|
|
|
|
ROLLBACK;
|
|
|
|
|
-- failures of local execution should rollback both the
|
|
|
|
|
-- local execution and remote executions
|
|
|
|
|
-- fail on a local execution
|
|
|
|
@ -1110,6 +1267,102 @@ LOG: executing the command locally: SELECT key, ser, ts, collection_id, value F
|
|
|
|
|
(2 rows)
|
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
|
TRUNCATE collections_list;
|
|
|
|
|
-- make sure that even if local execution is used, the sequence values
|
|
|
|
|
-- are generated locally
|
|
|
|
|
ALTER SEQUENCE collections_list_key_seq NO MINVALUE NO MAXVALUE;
|
|
|
|
|
PREPARE serial_prepared_local AS INSERT INTO collections_list (collection_id) VALUES (0) RETURNING key, ser;
|
|
|
|
|
SELECT setval('collections_list_key_seq', 4);
|
|
|
|
|
setval
|
|
|
|
|
--------
|
|
|
|
|
4
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE serial_prepared_local;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.collections_list_1470009 (key, ser, collection_id) VALUES ('5'::bigint, '3940649673949187'::bigint, 0) RETURNING key, ser
|
|
|
|
|
key | ser
|
|
|
|
|
-----+------------------
|
|
|
|
|
5 | 3940649673949187
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT setval('collections_list_key_seq', 5);
|
|
|
|
|
setval
|
|
|
|
|
--------
|
|
|
|
|
5
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE serial_prepared_local;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.collections_list_1470011 (key, ser, collection_id) VALUES ('6'::bigint, '3940649673949188'::bigint, 0) RETURNING key, ser
|
|
|
|
|
key | ser
|
|
|
|
|
-----+------------------
|
|
|
|
|
6 | 3940649673949188
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT setval('collections_list_key_seq', 499);
|
|
|
|
|
setval
|
|
|
|
|
--------
|
|
|
|
|
499
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE serial_prepared_local;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.collections_list_1470011 (key, ser, collection_id) VALUES ('500'::bigint, '3940649673949189'::bigint, 0) RETURNING key, ser
|
|
|
|
|
key | ser
|
|
|
|
|
-----+------------------
|
|
|
|
|
500 | 3940649673949189
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT setval('collections_list_key_seq', 700);
|
|
|
|
|
setval
|
|
|
|
|
--------
|
|
|
|
|
700
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE serial_prepared_local;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.collections_list_1470009 (key, ser, collection_id) VALUES ('701'::bigint, '3940649673949190'::bigint, 0) RETURNING key, ser
|
|
|
|
|
key | ser
|
|
|
|
|
-----+------------------
|
|
|
|
|
701 | 3940649673949190
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT setval('collections_list_key_seq', 708);
|
|
|
|
|
setval
|
|
|
|
|
--------
|
|
|
|
|
708
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE serial_prepared_local;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.collections_list_1470011 (key, ser, collection_id) VALUES ('709'::bigint, '3940649673949191'::bigint, 0) RETURNING key, ser
|
|
|
|
|
key | ser
|
|
|
|
|
-----+------------------
|
|
|
|
|
709 | 3940649673949191
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
SELECT setval('collections_list_key_seq', 709);
|
|
|
|
|
setval
|
|
|
|
|
--------
|
|
|
|
|
709
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE serial_prepared_local;
|
|
|
|
|
LOG: executing the command locally: INSERT INTO local_shard_execution.collections_list_1470009 (key, ser, collection_id) VALUES ('710'::bigint, '3940649673949192'::bigint, 0) RETURNING key, ser
|
|
|
|
|
key | ser
|
|
|
|
|
-----+------------------
|
|
|
|
|
710 | 3940649673949192
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
-- and, one remote test
|
|
|
|
|
SELECT setval('collections_list_key_seq', 10);
|
|
|
|
|
setval
|
|
|
|
|
--------
|
|
|
|
|
10
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
EXECUTE serial_prepared_local;
|
|
|
|
|
key | ser
|
|
|
|
|
-----+------------------
|
|
|
|
|
11 | 3940649673949193
|
|
|
|
|
(1 row)
|
|
|
|
|
|
|
|
|
|
-- the final queries for the following CTEs are going to happen on the intermediate results only
|
|
|
|
|
-- one of them will be executed remotely, and the other is locally
|
|
|
|
|
-- Citus currently doesn't allow using task_assignment_policy for intermediate results
|
|
|
|
|