-- See https://stackoverflow.com/a/15748896/3163905
-- Create a new sequence
CREATE sequence <column_id_seq>;
-- Alter the field you're converting to an auto-incrementing field be setting a default value based on a sequence
ALTER TABLE <table_name> alter <id_column> SET DEFAULT nextval(<'id_column_seq'>);
-- Set the current max value of the id column as the starting point for the sequence
SELECT setval(<'id_column_seq'>, <max_id_column_value> );