0

我有以下 .load 文件

LOAD DATABASE
     FROM      mysql://user:password@remotelocation/mydbname
     INTO postgresql://user@localhost/dbname

 WITH data only,truncate, workers = 8, concurrency = 1

  SET maintenance_work_mem to '128MB',
      work_mem to '12MB',
      search_path to 'mydbname'

 CAST type datetime to timestamptz drop default drop not null using zero-dates-to-null,
      type mediumint with extra auto_increment to bigserial,
      type date drop not null drop default using zero-dates-to-null,
      type tinyint to boolean using tinyint-to-boolean;

我得到错误

Database error 2BP01: cannot drop constraint random_pkey on table random because other objects depend on it. 

我可以在不删除密钥的情况下加载数据吗?我也尝试将disable triggers参数添加到 with 子句中,但效果不佳。

我使用的是 postgre 9.6,pgloader 的版本号是 3.3.2

4

1 回答 1

1

有两个项目解决了我的问题。第一个是include drop参数默认是打开的,所以我需要添加include no drop参数,第二个是这个区域最近修复了一些错误,所以我还需要从源代码编译 pgloader。

于 2017-05-16T14:52:57.683 回答