1
0
mirror of https://github.com/postgres/postgres.git synced 2026-10-23 13:29:09 +03:00
Amit Kapila 23fffd382c Fix logical replication with lossy identity indexes.
A GiST index on a multirange stores only its bounding range, so different
multiranges can produce the same index key. However,
RelationFindReplTupleByIndex() and RelationFindDeletedTupleInfoByIndex()
assume that matches through a primary key or replica identity index are
exact and skip the equality check. This can cause updates or deletes to
target the wrong row, and conflict detection to report update_deleted
instead of update_missing.

Fix this by rechecking candidates when the index scan sets xs_recheck.
Compare only the index key columns, using the scan keys' equality
operators and collations to match the index's notion of key equality.

Backpatch to 18, where WITHOUT OVERLAPS was introduced. The change to
RelationFindDeletedTupleInfoByIndex() applies only to 19 and later, where
update_deleted conflict detection was added.

Reported-by: Andres Freund <andres@anarazel.de>
Author: Paul A. Jungwirth <pj@illuminatedcomputing.com>
Author: Zhijie Hou <houzhijie22@gmail.com>
Reviewed-by: Nisha Moond <nisha.moond412@gmail.com>
Reviewed-by: kedar anavardekar <kedar.anavardekar@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Discussion: https://postgr.es/m/kcyaok346iwocfdourf2oojgtz7ggxmh2ugis7qqhggs4qfzc2@cu6pkox4rfwp
Discussion: https://postgr.es/m/e5nb5jbus2oa3pffmlo7pdvdckmchd54tqld4k3n6huyg5xxqn@7rounyvufjx6
Discussion: https://postgr.es/m/CA+renyWzTBC4GetPzJM1KqrejrmOWcGnn2NaA7tpee17HFxRPw@mail.gmail.com
Backpatch-through: 18
2026-10-21 08:34:27 +05:30
2025-08-14 12:09:53 -04:00
2025-08-15 10:32:22 +02:00
2022-12-04 15:23:00 -05:00
2024-11-05 13:56:02 +01:00
2026-08-11 14:38:31 -04:00
2026-08-11 14:38:31 -04:00
2026-01-01 13:24:10 -05:00
2020-02-10 20:47:50 +01:00
2026-08-11 14:38:31 -04:00

PostgreSQL Database Management System

This directory contains the source code distribution of the PostgreSQL database management system.

PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.

Copyright and license information can be found in the file COPYRIGHT.

General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/18/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/18/installation.html.

The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.

Description
Зеркало официального репозитория PostgreSQL GIT
Readme 1.3 GiB
Languages
C 83.9%
PLpgSQL 6.2%
Perl 5.4%
Yacc 1.2%
Meson 0.7%
Other 2.4%