aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache/lsyscache.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2014-08-06 16:06:06 -0400
committerRobert Haas <rhaas@postgresql.org>2014-08-06 16:06:06 -0400
commit1d41739e5a04b0e93304d24d864b6bfa3efc45f2 (patch)
tree0aeb675cf674213c05cd893360ab95e1ca7d0ac3 /src/backend/utils/cache/lsyscache.c
parent873de34b710196d1e3ce593bd85fa24768e58d6b (diff)
downloadpostgresql-1d41739e5a04b0e93304d24d864b6bfa3efc45f2.tar.gz
postgresql-1d41739e5a04b0e93304d24d864b6bfa3efc45f2.zip
Don't require sort support functions to provide a comparator.
This could be useful for datatypes like text, where we might want to optimize for some collations but not others. However, this patch doesn't introduce any new sortsupport functions that work this way; it merely revises the code so that future patches may do so. Patch by me. Review by Peter Geoghegan.
Diffstat (limited to 'src/backend/utils/cache/lsyscache.c')
-rw-r--r--src/backend/utils/cache/lsyscache.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c
index 4b5ef99531b..552e498cf57 100644
--- a/src/backend/utils/cache/lsyscache.c
+++ b/src/backend/utils/cache/lsyscache.c
@@ -246,62 +246,6 @@ get_ordering_op_properties(Oid opno,
}
/*
- * get_sort_function_for_ordering_op
- * Get the OID of the datatype-specific btree sort support function,
- * or if there is none, the btree comparison function,
- * associated with an ordering operator (a "<" or ">" operator).
- *
- * *sortfunc receives the support or comparison function OID.
- * *issupport is set TRUE if it's a support func, FALSE if a comparison func.
- * *reverse is set FALSE if the operator is "<", TRUE if it's ">"
- * (indicating that comparison results must be negated before use).
- *
- * Returns TRUE if successful, FALSE if no btree function can be found.
- * (This indicates that the operator is not a valid ordering operator.)
- */
-bool
-get_sort_function_for_ordering_op(Oid opno, Oid *sortfunc,
- bool *issupport, bool *reverse)
-{
- Oid opfamily;
- Oid opcintype;
- int16 strategy;
-
- /* Find the operator in pg_amop */
- if (get_ordering_op_properties(opno,
- &opfamily, &opcintype, &strategy))
- {
- /* Found a suitable opfamily, get matching support function */
- *sortfunc = get_opfamily_proc(opfamily,
- opcintype,
- opcintype,
- BTSORTSUPPORT_PROC);
- if (OidIsValid(*sortfunc))
- *issupport = true;
- else
- {
- /* opfamily doesn't provide sort support, get comparison func */
- *sortfunc = get_opfamily_proc(opfamily,
- opcintype,
- opcintype,
- BTORDER_PROC);
- if (!OidIsValid(*sortfunc)) /* should not happen */
- elog(ERROR, "missing support function %d(%u,%u) in opfamily %u",
- BTORDER_PROC, opcintype, opcintype, opfamily);
- *issupport = false;
- }
- *reverse = (strategy == BTGreaterStrategyNumber);
- return true;
- }
-
- /* ensure outputs are set on failure */
- *sortfunc = InvalidOid;
- *issupport = false;
- *reverse = false;
- return false;
-}
-
-/*
* get_equality_op_for_ordering_op
* Get the OID of the datatype-specific btree equality operator
* associated with an ordering operator (a "<" or ">" operator).