dimitri / pgloader

Migrate to PostgreSQL in a single command!
http://pgloader.io
Other
5.45k stars 548 forks source link

timestamp(6) issue with the zone #1489

Open IvanaKB opened 1 year ago

IvanaKB commented 1 year ago

pgloader reports the error of not creating the table because of the timestamp(6). I tried with the casting rule, but it didn't accept

CAST type timestamp without time zone(6) default NULL to timestamp(6) without time zone default NULL

load database
     from {{{SOURCE_DB}}}
     into {{{TARGET_DB}}}

ALTER SCHEMA 'public' RENAME TO 'test_stitch_generations'

BEFORE LOAD DO
    $$ drop schema if exists test_stitch_generations cascade; $$,
    $$ create schema if not exists test_stitch_generations; $$,
    $$ alter database postgres SET search_path TO test_stitch_generations; $$;
ERROR Database error 42601: syntax error at or near "("
QUERY: CREATE TABLE "public"."maintenance_tasks_runs"
(
"id" bigserial,
"task_name" text default NULL,
"started_at" timestamp without time zone default NULL,
"ended_at" timestamp without time zone default NULL,
"time_running" double precision default 0.0,
"tick_count" bigint default 0,
"tick_total" bigint default NULL,
"job_id" text default NULL,
"cursor" bigint default NULL,
"status" text default 'enqueued'::character varying,
"error_class" text default NULL,
"error_message" text default NULL,
"backtrace" text default NULL,
"created_at" timestamp without time zone(6) default NULL,
"updated_at" timestamp without time zone(6) default NULL,
"arguments" text default NULL,
"lock_version" integer default 0
);

CREATE TABLE "public"."maintenance_tasks_runs"
(
"id" bigserial,
"task_name" text default NULL,
"started_at" timestamp without time zone default NULL,
"ended_at" timestamp without time zone default NULL,
"time_running" double precision default 0.0,
"tick_count" bigint default 0,
"tick_total" bigint default NULL,
"job_id" text default NULL,
"cursor" bigint default NULL,
"status" text default 'enqueued'::character varying,
"error_class" text default NULL,
"error_message" text default NULL,
"backtrace" text default NULL,
"created_at" timestamp without time zone(6) default NULL,
"updated_at" timestamp without time zone(6) default NULL,
"arguments" text default NULL,
"lock_version" integer default 0
);```

  - [ ] How the data is different from what you expected, if relevant