mirror of
https://github.com/postgres/postgres.git
synced 2025-06-25 01:02:05 +03:00
Cross-data-type comparisons are now indexable by btrees, pursuant to my
pghackers proposal of 8-Nov. All the existing cross-type comparison operators (int2/int4/int8 and float4/float8) have appropriate support. The original proposal of storing the right-hand-side datatype as part of the primary key for pg_amop and pg_amproc got modified a bit in the event; it is easier to store zero as the 'default' case and only store a nonzero when the operator is actually cross-type. Along the way, remove the long-since-defunct bigbox_ops operator class.
This commit is contained in:
@ -15,7 +15,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.147 2003/10/16 21:37:54 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.148 2003/11/12 21:15:55 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -952,7 +952,8 @@ patternsel(PG_FUNCTION_ARGS, Pattern_Type ptype)
|
||||
/*
|
||||
* Pattern specifies an exact match, so pretend operator is '='
|
||||
*/
|
||||
Oid eqopr = get_opclass_member(opclass, BTEqualStrategyNumber);
|
||||
Oid eqopr = get_opclass_member(opclass, InvalidOid,
|
||||
BTEqualStrategyNumber);
|
||||
List *eqargs;
|
||||
|
||||
if (eqopr == InvalidOid)
|
||||
@ -3382,7 +3383,8 @@ prefix_selectivity(Query *root, Var *var, Oid opclass, Const *prefixcon)
|
||||
List *cmpargs;
|
||||
Const *greaterstrcon;
|
||||
|
||||
cmpopr = get_opclass_member(opclass, BTGreaterEqualStrategyNumber);
|
||||
cmpopr = get_opclass_member(opclass, InvalidOid,
|
||||
BTGreaterEqualStrategyNumber);
|
||||
if (cmpopr == InvalidOid)
|
||||
elog(ERROR, "no >= operator for opclass %u", opclass);
|
||||
cmpargs = makeList2(var, prefixcon);
|
||||
@ -3403,7 +3405,8 @@ prefix_selectivity(Query *root, Var *var, Oid opclass, Const *prefixcon)
|
||||
{
|
||||
Selectivity topsel;
|
||||
|
||||
cmpopr = get_opclass_member(opclass, BTLessStrategyNumber);
|
||||
cmpopr = get_opclass_member(opclass, InvalidOid,
|
||||
BTLessStrategyNumber);
|
||||
if (cmpopr == InvalidOid)
|
||||
elog(ERROR, "no < operator for opclass %u", opclass);
|
||||
cmpargs = makeList2(var, greaterstrcon);
|
||||
|
Reference in New Issue
Block a user