diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2024-12-10 12:53:27 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2024-12-10 12:53:27 +0100 |
commit | a2a475b011cf7c25f5a09574def35b335af844ac (patch) | |
tree | 0dd334d41dcdf83e8e4ffb2fc280f12a6b696098 /src/backend/executor/execReplication.c | |
parent | 321c287351f707c38c1fa94c1ac89bcc3134ed59 (diff) | |
download | postgresql-a2a475b011cf7c25f5a09574def35b335af844ac.tar.gz postgresql-a2a475b011cf7c25f5a09574def35b335af844ac.zip |
Replace get_equal_strategy_number_for_am() by get_equal_strategy_number()
get_equal_strategy_number_for_am() gets the equal strategy number for
an AM. This currently only supports btree and hash. In the more
general case, this also depends on the operator class (see for example
GistTranslateStratnum()). To support that, replace this function with
get_equal_strategy_number() that takes an opclass and derives it from
there. (This function already existed before as a static function, so
the signature is kept for simplicity.)
This patch is only a refactoring, it doesn't add support for other
index AMs such as gist. This will be done separately.
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
Diffstat (limited to 'src/backend/executor/execReplication.c')
-rw-r--r-- | src/backend/executor/execReplication.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/backend/executor/execReplication.c b/src/backend/executor/execReplication.c index c8b79f42c24..4431f6b9ecf 100644 --- a/src/backend/executor/execReplication.c +++ b/src/backend/executor/execReplication.c @@ -39,7 +39,7 @@ static bool tuples_equal(TupleTableSlot *slot1, TupleTableSlot *slot2, /* * Returns the fixed strategy number, if any, of the equality operator for the - * given index access method, otherwise, InvalidStrategy. + * given operator class, otherwise, InvalidStrategy. * * Currently, only Btree and Hash indexes are supported. The other index access * methods don't have a fixed strategy for equality operation - instead, the @@ -47,8 +47,9 @@ static bool tuples_equal(TupleTableSlot *slot1, TupleTableSlot *slot2, * according to the operator class's definition. */ StrategyNumber -get_equal_strategy_number_for_am(Oid am) +get_equal_strategy_number(Oid opclass) { + Oid am = get_opclass_method(opclass); int ret; switch (am) @@ -69,18 +70,6 @@ get_equal_strategy_number_for_am(Oid am) } /* - * Return the appropriate strategy number which corresponds to the equality - * operator. - */ -static StrategyNumber -get_equal_strategy_number(Oid opclass) -{ - Oid am = get_opclass_method(opclass); - - return get_equal_strategy_number_for_am(am); -} - -/* * Setup a ScanKey for a search in the relation 'rel' for a tuple 'key' that * is setup to match 'rel' (*NOT* idxrel!). * |