Skip to content

Instantly share code, notes, and snippets.

@dijit
Created March 11, 2014 15:43
Show Gist options
  • Save dijit/9488439 to your computer and use it in GitHub Desktop.
Save dijit/9488439 to your computer and use it in GitHub Desktop.
Drop all sequences (pgsql)
for i in $( sudo -u postgres psql -q -t -d firebox\
-c "SELECT 'drop sequence ' || c.relname || ';' \
FROM pg_class c WHERE (c.relkind = 'S');" ); do
sudo -u postgres psql -d firebox -c "$i";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment