PostgreSQL Autoincrement

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

Add a comment


Would you like to get top 5 links on Programming every Monday?
Sign up to Programming Digest and stay up to date!