diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml index 0d88cbfd4fd..5f0afb2a796 100644 --- a/doc/src/sgml/logical-replication.sgml +++ b/doc/src/sgml/logical-replication.sgml @@ -2441,6 +2441,23 @@ SELECT (replica_identity->>'doc')::jsonb->>'x' FROM ...; -- 1 + + The apply worker's and + settings change how a value + is written without changing the value itself. If these settings differ + between conflicts, the same key can be recorded in different but + equivalent forms, and comparing the recorded text may miss some of them. + To match conflicts on the same key, cast the value back to the column's + type instead, here for a bytea key column b + and a regclass[] key column r: + +SELECT * FROM ... WHERE replica_identity->>'b' = '\x0102'; -- may miss rows +SELECT * FROM ... WHERE (replica_identity->>'b')::bytea = '\x0102'; -- matches all +SELECT * FROM ... WHERE replica_identity->>'r' = '{t}'; -- may miss rows +SELECT * FROM ... WHERE (replica_identity->>'r')::regclass[] = '{t}'; -- matches all + + + If a key value's text representation is larger than 64kB, it is not recorded. In its place the conflict log stores a small object marking it