postgres alter sequence
* How to reset sequence in postgres and fill id column with new data?
alter sequence seq restart with 5;
update t set id = nextval('seq');
select setval('TABLE_COLUMN_seq'::regclass, (select MAX(COLUMN) FROM TABLE) + 1);
↧