I\'m converting a db from postgres to mysql.
Since i cannot find a tool that does the trick itself, i\'m going to convert all postgres sequences to autoincrement id
Here is an example how to use psql
to get a list of all sequences with their last_value
:
psql -U <username> -d <database> -t -c "SELECT 'SELECT ''' || c.relname || ''' as sequence_name, last_value FROM ' || c.relname || ';' FROM pg_class c WHERE (c.relkind = 'S')" | psql -U <username> -d <database> -t