postgre 批量删除表
注意:使用时请注意,表名一定要写对,否则有可能误删!!!
do
$$
declare
select_results record;
table_name varchar;
begin
for select_results in
select tablename from pg_tables where schemaname='表空间' and tablename like '表名%'
loop
table_name=select_results.tablename;
execute 'drop table ' || table_name;
END LOOP;
end;
$$