2017-05-09 17 views
0

我有以下.load文件如何在通過pgloader加載數據時解決這個約束錯誤?

LOAD DATABASE 
    FROM  mysql://user:[email protected]/mydbname 
    INTO postgresql://[email protected]/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

回答

0

有兩個項目是固定我的問題。第一個參數include drop默認打開,所以我需要添加include no drop參數,其次一些bug最近在這個區域修復了,所以我還需要從源代碼編譯pgloader。