-- DROP PROCEDURE schema_xyz.pattern_matching_b_iii_pg(varchar, varchar, varchar);
CREATE OR REPLACE PROCEDURE schema_xyz.pattern_matching_b_iii_pg(input_table character varying, output_table character varying, process_name character varying)
LANGUAGE plpgsql
AS $procedure$
#variable_conflict use_variable
Declare
/*
Assignment on lowest level.
input_table: result_V
output_table: result_VI
*/
my_uid RECORD;
publ RECORD;
input_table_without_schema character varying:= split_part(input_table,'.',2);
BEGIN
execute 'drop table if exists schema_xyz.relation_017';
execute 'create table schema_xyz.relation_017 as (select * from schema_xyz.relation where type in (0,1,7))';
execute 'drop index if exists schema_xyz.i_rel_017_1';
execute 'drop index if exists schema_xyz.i_rel_017_2';
execute 'create index i_rel_017_1 on schema_xyz.relation_017(uid_0)';
execute 'create index i_rel_017_2 on schema_xyz.relation_017(uid_1)';