pgloader icon indicating copy to clipboard operation
pgloader copied to clipboard

MYSQL to Postgres : reset sequence not working

Open signmeuptwice opened this issue 7 months ago • 1 comments

  • [ ] pgloader --version

    3.6.7~devel
    

it seems that pgloader is not executing reset sequence if there is a CAST

In the following load file if I remove the CAST then I can insert a new record in my database after migration. If I have the CAST inserting a new record results in error duplicate id

LOAD DATABASE
    FROM      mysql://root:root@database/dev
    INTO      pgsql://app:pass@postgres/dev

    WITH include drop, create tables, create indexes, reset sequences,
    workers = 8, concurrency = 1,
    multiple readers per thread, rows per range = 50000

    SET PostgreSQL PARAMETERS
        maintenance_work_mem to '128MB',
        work_mem to '12MB',
        search_path to 'mr_dev, public, "$user"'

    CAST column article.emoji to jsonb,
         column post.emoji to jsonb


    ALTER SCHEMA 'dev' RENAME TO 'public'

    BEFORE LOAD DO
    $$ create schema if not exists dev; $$;

signmeuptwice avatar Jul 21 '24 16:07 signmeuptwice