【发布时间】:2021-04-08 05:14:42
【问题描述】:
我正在尝试将一些数据从一个 postgres rds 迁移到另一个 postgres rds,但我一直遇到ERROR: duplicate key value violates unique constraint "abcd_xyz"。我已将session_replication_role 参数组值更新为replica,但似乎仍然无法超越该限制(以及我会遇到的其他限制)。
演示数据,但即使我设置了set session_replication_role to 'replica';...我仍然得到同样的错误
user ~/Git/go-dlp $ psql -h blah.us-east-1.rds.amazonaws.com -U user1 -d db1
Password for user user1:
psql (13.2, server 11.6)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.
db1=>
db1=>
db1=> set session_replication_role to 'replica';
SET
db1=> UPDATE userinfo_v3 SET firstname = 'Alana', lastname = 'Crooks', mobilephone = '+17368645273', ssn = '666612345', ssnhash = '3895fa77f6d70c8c9401275829c78020' WHERE id = '73838726';
UPDATE 1
db1=> UPDATE userinfo_v3 SET firstname = 'Leann', lastname = 'Crist', mobilephone = '+16970011319', ssn = '666612345', ssnhash = '3895fa77f6d70c8c9401275829c78020' WHERE id = '1470593';
ERROR: duplicate key value violates unique constraint "abcd_xyz"
DETAIL: Key (ssnhash)=(3895fa77f6d70c8c9401275829c78020) already exists.
我认为我已经设置了所有正确的参数,但由于某种原因我仍然无法超越该限制
【问题讨论】:
标签: postgresql amazon-rds