pg报错:SQL 错误 [55000]: ERROR: cannot delete from table “caq“ because it does not have a replica identi

pg报错:SQL 错误 [55000]: ERROR: cannot delete from table "caq" because it does not have a replica identity and publishes updates

Hint: To enable updating from the table, set REPLICA IDENTITY using ALTER TABLE.

解决方案:

如果一张表缺少主键,并且涉及到update和delete,需要执行

ALTER TABLE caq REPLICA IDENTITY FULL;