I Work with Postgresql and I want to drop Table if exists .My code is
execute 'drop table if exists production.'|| layer_name || '' into result_var;
exception
when others then
execute 'insert into production.'|| layer_name || ' select * from staging.'|| layer_name ;
return 1;
but table if not exists thows exeption .I do not want to trow exeption
Can anybody help me?
SQLERRMorGET STACKED DIAGNOSTICS. See postgresql.org/docs/current/static/…