public.tmp | f | | | | | | 0 |
(2 rows)
+select * from londiste.local_set_table_state('branch_set', 'public.slavedata', null, 'in-copy');
+ ret_code | ret_note
+----------+-----------------------------------------------
+ 200 | Table public.slavedata state set to 'in-copy'
+(1 row)
+
+select * from londiste.get_table_list('branch_set');
+ table_name | local | merge_state | custom_snapshot | table_attrs | dropped_ddl | copy_role | copy_pos | dest_table
+------------------+-------+-------------+-----------------+-------------+-------------+-----------+----------+------------
+ public.slavedata | t | in-copy | | | | | 0 |
+ public.tmp | f | | | | | | 0 |
+(2 rows)
+
select * from londiste.global_remove_table('branch_set', 'public.tmp');
ret_code | ret_note
----------+---------------------------
-- be more robust against late joiners
q_part1 := coalesce(q_part_ddl, q_part1);
+ -- turn the logic off if no merge is happening
+ if n_parts = 1 then
+ q_part1 := null;
+ end if;
+
if q_part1 is not null then
if i_queue_name = q_part1 then
-- lead
select * from londiste.local_add_table('branch_set', 'public.slavedata');
select * from londiste.global_add_table('branch_set', 'public.tmp');
select * from londiste.get_table_list('branch_set');
+
+select * from londiste.local_set_table_state('branch_set', 'public.slavedata', null, 'in-copy');
+select * from londiste.get_table_list('branch_set');
+
select * from londiste.global_remove_table('branch_set', 'public.tmp');
select * from londiste.local_remove_table('branch_set', 'public.slavedata');
select * from londiste.local_remove_table('branch_set', 'public.slavedata');