4 Answers 4 ; 537 · SELECT * FROM pg_stat_activity WHERE datname='database name'; · DROP DATABASE dbname WITH (FORCE); ; 131 · select · from ... ... <看更多>
Search
Search
4 Answers 4 ; 537 · SELECT * FROM pg_stat_activity WHERE datname='database name'; · DROP DATABASE dbname WITH (FORCE); ; 131 · select · from ... ... <看更多>
You can use the -c option repeatedly: psql -c 'DROP DATABASE my_db' -c 'CREATE DATABASE my_db'. ... <看更多>
Postgresql 12 and earlier has no force option, but dropping all sessions and then drop database is possible. ... <看更多>