Created
November 17, 2020 20:27
-
-
Save nmenag/8f10333723be3b343cb4debddcd686d2 to your computer and use it in GitHub Desktop.
Drop multiples databases Postgres
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
psql -h localhost -U postgres -d postgres -c "copy (select datname from pg_database where datname like '%nominapp_api%') to stdout" | while read line; do | |
echo "$line" | |
dropdb -i "$line" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment