Last active
August 29, 2017 18:39
-
-
Save internetuser2008/2b8474d97ce16a82c2a1c4e19fc3e56f to your computer and use it in GitHub Desktop.
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
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