我有我的數據庫中的一捆表。我需要截斷所有的表格,但不是一些。需要添加到srting postgresql select查詢結果
所以通過使用table_schema我可以得到表名單!
select ''as "truncate", table_name
from information_schema.tables
where table_schema = 'public'
預期輸出。
truncate table table_name restart identity.
有人告訴我有沒有更好的方法來做到這一點。