user965692
user965692

Reputation: 221

How do I alter sequences in Postgres with BDR

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

Answers (0)

Related Questions