清空PG库中所有表中数据SQL脚本
DO $$DECLARE names CURSOR FORselect tablename from pg_tables where schemaname='public';BEGINFOR stmt IN names LOOPEXECUTE 'truncate table '|| quote_ident(stmt.tablename);END LOO...
·
DO $$
DECLARE names CURSOR FOR
select tablename from pg_tables where schemaname='public';
BEGIN
FOR stmt IN names LOOP
EXECUTE 'truncate table '|| quote_ident(stmt.tablename);
END LOOP;
END; $$
更多推荐



所有评论(0)