I know how to fix the seq when it is out of sync with a table:
SELECT setval('tablename_seq',(SELECT max(tbl_id_col) FROM tablename));
My question: anyone know how they get out of sync in the first place?
The only code we have that inserts doesn't reference the id column, so PGsql should get the nextval and increment the seq. The only scenarios I can think of are someone manually inserting or updating a lower key record from the console.
Frank
SELECT setval('tablename_seq',(SELECT max(tbl_id_col) FROM tablename));
My question: anyone know how they get out of sync in the first place?
The only code we have that inserts doesn't reference the id column, so PGsql should get the nextval and increment the seq. The only scenarios I can think of are someone manually inserting or updating a lower key record from the console.
Frank