pgsync icon indicating copy to clipboard operation
pgsync copied to clipboard

Supporting UUIDv7 with "--in-batches"

Open ahollmann opened this issue 1 year ago • 0 comments

Hi @ankane,

--in-batches is only working with numeric primary keys (https://github.com/ankane/pgsync/issues/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).

ahollmann avatar Feb 08 '24 12:02 ahollmann