Reputation: 221
We are doing some database migration in Postgres (in two-node BDR cluster).
Because of some unrelated issue, sequence on certain tables are out of sync and need to be reset.
We tried the setval
(and ALTER SEQUENCE
) but both failed.
SELECT setval('mytable_id_seq', (SELECT MAX(id) FROM mytable));
ERROR: cannot call setval() on global sequence public.mytable_id_seq
ALTER SEQUENCE mytable_id_seq RESTART WITH 48800;
ERROR: ALTER SEQUENCE ... restart is not supported for bdr sequences
Upvotes: 4
Views: 816