Postgres: make column serial

CREATE SEQUENCE users_id_seq;
ALTER TABLE users ALTER COLUMN id SET DEFAULT nextval('users_id_seq');
ALTER SEQUENCE users_id_seq  OWNED BY users.id;

-- if the table was created by a different user
ALTER TABLE users OWNER TO current_user;