We're doing a Postgres native logical replication between two databases.
Now, we're getting an error trying to update from the publisher one of thousand tables that we have.
When we try to update the table it returns this error:
ERROR: Column list used by the publication does not cover the replica identity.cannot update table "etiquetas_j".
ERROR: cannot update table "etiquetas_j" Estado SQL: 42P10 Detalle: Column list used by the publication does not cover the replica identity.
The table definition, datatypes, indexes, and pkeys are the same at publisher and subscriptor
See here:
Publisher:
CREATE TABLE IF NOT EXISTS public.etiquetas_j (
etiqueta_id integer NOT NULL,
fecha timestamp without time zone,
j_id integer NOT NULL,
usuario_del_id integer,
usuario_mod_id integer,
organigrama_mod character varying(2) COLLATE pg_catalog."default",
id integer NOT NULL DEFAULT nextval('etiquetas_j_id_seq1'::regclass),
CONSTRAINT etiquetas_j_pkey PRIMARY KEY (id))
TABLESPACE pg_default; ALTER TABLE IF EXISTS public.etiquetas_j
OWNER to postgres;
CREATE INDEX IF NOT EXISTS etiquetas_j_etiqueta_id_idx
ON public.etiquetas_j USING btree
(etiqueta_id ASC NULLS LAST)
TABLESPACE pg_default;
CREATE INDEX IF NOT EXISTS etiquetas_j_id_idx
ON public.etiquetas_j USING btree
(j_id ASC NULLS LAST)
TABLESPACE pg_default;
Subscriptor:
CREATE TABLE IF NOT EXISTS public.etiquetas_j
(
etiqueta_id integer NOT NULL,
fecha timestamp without time zone,
j_id integer NOT NULL,
usuario_del_id integer,
usuario_mod_id integer,
organigrama_mod character varying(2) COLLATE pg_catalog."default",
id integer NOT NULL DEFAULT nextval('etiquetas_j_id_seq1'::regclass),
CONSTRAINT etiquetas_j_pkey PRIMARY KEY (id)
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.etiquetas_j
OWNER to postgres;
CREATE INDEX IF NOT EXISTS etiquetas_j_etiqueta_id_idx
ON public.etiquetas_j USING btree
(etiqueta_id ASC NULLS LAST)
TABLESPACE pg_default;
CREATE INDEX IF NOT EXISTS etiquetas_j_id_idx
ON public.etiquetas_j USING btree
(j_id ASC NULLS LAST)
TABLESPACE pg_default;
The publication is defined as follows:
CREATE PUBLICATION publication_visor FOR TABLE etiquetas_j(
etiqueta_id,
fecha,
j_id,
usuario_del_id,
usuario_mod_id ,
organigrama_mod,
id)
The error occurs when we execute in the provider:
update etiquetas_j set organigrama_mod = '02' where id = 3;
Thanks, and sorry for the bad english!
We have already checked:
- See what the indexes are.
- See what differs in both schemas.
- See what publisher was sending at publication create.
- Applied ALTER TABLE etiquetas_j REPLICA IDENTITY FULL;