posgtresql — delete some tables with special name format

create or replace function DropTables(TEXT) returns void AS $$
declare
  r record;
begin
 for r in select * from pg_tables where tablename like $1 loop
   raise notice 'drop %.%', r.schemaname, r.tablename;
   EXECUTE 'DROP TABLE ' || quote_ident(r.schemaname) || '.' || quote_ident(r.tablename);
 end loop;
end;
$$language plpgsql;

How to use:

select DropTables ('f.%');
this request delete tables with next name:
f.sdf
f.sde43t45
f.tgbtb