Skip to content

Commit 74edabc

Browse files
committed
Support for GiST in get_equal_strategy_number()
A WITHOUT OVERLAPS primary key or unique constraint is accepted as a REPLICA IDENTITY, since it guarantees uniqueness. But subscribers applying logical decoding messages would fail because there was not support for looking up the equals operator for a gist index. This fixes that: For GiST indexes we can use the stratnum GiST support function. Reviewed-by: Paul Jungwirth <pj@illuminatedcomputing.com> Reviewed-by: vignesh C <vignesh21@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/CA+renyUApHgSZF9-nd-a0+OPGharLQLO=mDHcY4_qQ0+noCUVg@mail.gmail.com
1 parent 13544e7 commit 74edabc

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/backend/executor/execReplication.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "postgres.h"
1616

1717
#include "access/genam.h"
18+
#include "access/gist.h"
1819
#include "access/relscan.h"
1920
#include "access/tableam.h"
2021
#include "access/transam.h"
@@ -40,11 +41,6 @@ static bool tuples_equal(TupleTableSlot *slot1, TupleTableSlot *slot2,
4041
/*
4142
* Returns the fixed strategy number, if any, of the equality operator for the
4243
* given operator class, otherwise, InvalidStrategy.
43-
*
44-
* Currently, only Btree and Hash indexes are supported. The other index access
45-
* methods don't have a fixed strategy for equality operation - instead, the
46-
* support routines of each operator class interpret the strategy numbers
47-
* according to the operator class's definition.
4844
*/
4945
StrategyNumber
5046
get_equal_strategy_number(Oid opclass)
@@ -60,8 +56,10 @@ get_equal_strategy_number(Oid opclass)
6056
case HASH_AM_OID:
6157
ret = HTEqualStrategyNumber;
6258
break;
59+
case GIST_AM_OID:
60+
ret = GistTranslateStratnum(opclass, RTEqualStrategyNumber);
61+
break;
6362
default:
64-
/* XXX: Only Btree and Hash indexes are supported */
6563
ret = InvalidStrategy;
6664
break;
6765
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy