PostgreSQL Autoincrement

CREATE SEQUENCE tablename_col_seq;
 
ALTER TABLE tablename
    ALTER columname set default nextval('tablename_col_seq');

Did you like the article? Send me a comment!