Skip to content

Instantly share code, notes, and snippets.

@vishesh
Created August 13, 2013 09:37
Show Gist options
  • Select an option

  • Save vishesh/6219481 to your computer and use it in GitHub Desktop.

Select an option

Save vishesh/6219481 to your computer and use it in GitHub Desktop.
Drop all test_* databases in Postgres
# Drop all test_* databases in Postgres
function dropalldb()
{
for db in `psql -l | cat | egrep -o "test_[0-9]*"`; do
echo "Dropping " $db
dropdb $db;
done;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment