ankane/pgsync

Supporting UUIDv7 with "--in-batches"

ahollmann opened this issue · 1 comments

Hi @ankane,

--in-batches is only working with numeric primary keys (#10).

Can this restriction be lifted to make it work with sortable UUIDs? Currently I get following error:

operator does not exist: uuid >= integer
LINE 1: ... "schema"."table" WHERE "id" >= 2 AND "...
                                                             ^
HINT:  No operator matches the given name and argument types. You might need to add explicit type casts.

UUIDs don't have the required max/min functions defined, but they can be added (https://dba.stackexchange.com/questions/275251/why-is-there-no-maxuuid-minuuid-function).

Hi @ahollmann, sorry for the delay. --in-batches expects the primary key to be monotonically increasing, which isn't the case with UUIDv7.