From 6339f6468e8217f556e38482626250dc72d7cd00 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 15 Jan 2025 08:31:46 +0100 Subject: Rename RowCompareType to CompareType RowCompareType served as a way to describe the fundamental meaning of an operator, notionally independent of an operator class (although so far this was only really supported for btrees). Its original purpose was for use inside RowCompareExpr, and it has also found some small use outside, such as for get_op_btree_interpretation(). We want to expand this now, as a more general way to describe operator semantics for other index access methods, including gist (to improve GistTranslateStratnum()) and others not written yet. To avoid future confusion, we rename the type to CompareType and the symbols from ROWCOMPARE_XXX to COMPARE_XXX to reflect their more general purpose. Reviewed-by: Mark Dilger Discussion: https://www.postgresql.org/message-id/flat/E72EAA49-354D-4C2E-8EB9-255197F55330@enterprisedb.com --- src/backend/parser/parse_expr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/backend/parser/parse_expr.c') diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c index d1f64f8f0a5..285a5c88d58 100644 --- a/src/backend/parser/parse_expr.c +++ b/src/backend/parser/parse_expr.c @@ -2807,7 +2807,7 @@ make_row_comparison_op(ParseState *pstate, List *opname, List *largs, List *rargs, int location) { RowCompareExpr *rcexpr; - RowCompareType rctype; + CompareType cmptype; List *opexprs; List *opnos; List *opfamilies; @@ -2928,15 +2928,15 @@ make_row_comparison_op(ParseState *pstate, List *opname, errhint("Row comparison operators must be associated with btree operator families."), parser_errposition(pstate, location))); } - rctype = (RowCompareType) i; + cmptype = (CompareType) i; /* * For = and <> cases, we just combine the pairwise operators with AND or * OR respectively. */ - if (rctype == ROWCOMPARE_EQ) + if (cmptype == COMPARE_EQ) return (Node *) makeBoolExpr(AND_EXPR, opexprs, location); - if (rctype == ROWCOMPARE_NE) + if (cmptype == COMPARE_NE) return (Node *) makeBoolExpr(OR_EXPR, opexprs, location); /* @@ -2953,7 +2953,7 @@ make_row_comparison_op(ParseState *pstate, List *opname, { OpBtreeInterpretation *opinfo = lfirst(j); - if (opinfo->strategy == rctype) + if (opinfo->strategy == cmptype) { opfamily = opinfo->opfamily_id; break; @@ -2989,7 +2989,7 @@ make_row_comparison_op(ParseState *pstate, List *opname, } rcexpr = makeNode(RowCompareExpr); - rcexpr->rctype = rctype; + rcexpr->cmptype = cmptype; rcexpr->opnos = opnos; rcexpr->opfamilies = opfamilies; rcexpr->inputcollids = NIL; /* assign_expr_collations will fix this */ -- cgit v1.2.3