I am trying to drop table if exists else proceed for next step in function using PostgreSQL 9.3 version.
Example:
  Create or replace function test(tablename varchar)
  returns setof record as
  $$
  Declare
        var1 varchar :='table_';
  Begin
        var1 :=var1 ||tablename;
        /* Here need to drop table if exists */
       drop table if exist var1;
       /* else proceed for next step */
       ....
       ....
   end;
   $$
   language plpgsql;
    
drop tableworks in yourFunction?