Created
August 21, 2014 20:46
-
-
Save moylop260/0fa6a7863833638c593e to your computer and use it in GitHub Desktop.
This file contains 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
--Save out in dropdb.sh and execute with chmod +x | |
--This delete all database of runbot app | |
SELECT 'dropdb ' || '"' || datname || '"' AS dropcmd | |
FROM pg_catalog.pg_database d | |
WHERE --datname ~ E'^\[0-9]{5}-[\w|\-|.]*' AND | |
pg_catalog.pg_get_userbyid(d.datdba) = 'runbot' | |
AND (datname like '%-base' OR datname like '%-all') | |
ORDER BY 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment