ERROR: query failed: ERROR: cannot update table "table_123" because it does not have a replica identity and publishes updates
HINT: To enable updating the table, set REPLICA IDENTITY using ALTER TABLE.
CONTEXT: SQL statement "UPDATE repack.table_123 SET (id, automation_job_member_id, action_id, csm_field_id, target_type, status, external_status, status_description, valid_at, started_at, completed_at, created_at, updated_at, target_identifier) = ($2.id, $2.automation_job_member_id, $2.action_id, $2.csm_field_id, $2.target_type, $2.status, $2.external_status, $2.status_description, $2.valid_at, $2.started_at, $2.completed_at, $2.created_at, $2.updated_at, $2.target_identifier) WHERE (id) = ($1.id)"
DETAIL: query was: SELECT repack.repack_apply($1, $2, $3, $4, $5, $6)
DEBUG: No workers to disconnect.
我在PostgreSQL中使用的是“dbzm”发布,它被创建为包含所有表。但是,我无法提供复制副本标识,也无法删除复制副本。
我试图从发布中删除由“repack”创建的表,但无法删除该表,因为发布被配置为包括所有表。
postgres=> ALTER PUBLICATION dbzm_postgres DROP TABLE repack.table_123;
ERROR: publication "dbzm_postgres" is defined as FOR ALL TABLES
DETAIL: Tables cannot be added to or dropped from FOR ALL TABLES publications.
1条答案
按热度按时间7rfyedvj1#
看起来
pg_repack
创建了没有主键的表,可能是为了快速加载。这不能用于逻辑复制。因此,似乎无法在复制表上运行pg_repack
。从复制的Angular 来看,这也是有意义的,因为新表与旧表不同,逻辑解码将无法工作。在运行
pg_repack
之前,请不要使用pg_repack
或从发布中删除该表。之后,您可以再次添加它。您可能必须从头开始初始化表的复制。