postgresql
常用命令
数据库层面
# 1. 只生成,不执行,先过目
sudo -u postgres psql -c "SELECT datname FROM pg_database WHERE datname LIKE 'group%';"
# 2. 确认无误后,批量生成并执行
sudo -u postgres psql -tAq -c "SELECT 'DROP DATABASE '||quote_ident(datname)||';' FROM pg_database WHERE datname LIKE 'group%';" \
| sudo -u postgres psql -d postgres

浙公网安备 33010602011771号