Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save internetuser2008/2b8474d97ce16a82c2a1c4e19fc3e56f to your computer and use it in GitHub Desktop.
Save internetuser2008/2b8474d97ce16a82c2a1c4e19fc3e56f to your computer and use it in GitHub Desktop.
IFS=$'\n'; for i in `psql -Upostgres -Atc "select concat(sequence_schema,'.','\"',sequence_name,'\"') from information_schema.sequences;"`; do echo $i; psql -Upostgres -c "select sequence_name, last_value, max_value, (last_value/max_value)*100 as percentage from $i;"; done; $IFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment