Skip to content

Commit eba125c

Browse files
committed
remove triconsistent method. use pre_consistent instead
1 parent b6b751f commit eba125c

File tree

3 files changed

+15
-27
lines changed

3 files changed

+15
-27
lines changed

rum--1.0.sql

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,9 @@ AS
5959
FUNCTION 3 rum_extract_tsquery(tsquery,internal,smallint,internal,internal,internal,internal),
6060
FUNCTION 4 rum_tsquery_consistent(internal,smallint,tsvector,int,internal,internal,internal,internal),
6161
FUNCTION 5 gin_cmp_prefix(text,text,smallint,internal),
62-
FUNCTION 6 gin_tsquery_triconsistent(internal,smallint,tsvector,int,internal,internal,internal),
63-
FUNCTION 7 rum_tsvector_config(internal),
64-
FUNCTION 8 rum_tsquery_pre_consistent(internal,smallint,tsvector,int,internal,internal,internal,internal),
65-
FUNCTION 9 rum_tsquery_distance(internal,smallint,tsvector,int,internal,internal,internal,internal,internal),
62+
FUNCTION 6 rum_tsvector_config(internal),
63+
FUNCTION 7 rum_tsquery_pre_consistent(internal,smallint,tsvector,int,internal,internal,internal,internal),
64+
FUNCTION 8 rum_tsquery_distance(internal,smallint,tsvector,int,internal,internal,internal,internal,internal),
6665
STORAGE text;
6766

6867
-- timestamp ops
@@ -146,7 +145,7 @@ AS
146145
FUNCTION 4 rum_timestamp_consistent(internal,smallint,timestamp,int,internal,internal,internal,internal),
147146
FUNCTION 5 rum_timestamp_compare_prefix(timestamp,timestamp,smallint,internal),
148147
-- support to timestamp disttance in rum_tsvector_timestamp_ops
149-
FUNCTION 10 rum_timestamp_outer_distance(timestamp, timestamp, smallint),
148+
FUNCTION 9 rum_timestamp_outer_distance(timestamp, timestamp, smallint),
150149
OPERATOR 20 <-> (timestamp,timestamp) FOR ORDER BY pg_catalog.float_ops,
151150
OPERATOR 21 <-| (timestamp,timestamp) FOR ORDER BY pg_catalog.float_ops,
152151
OPERATOR 22 |-> (timestamp,timestamp) FOR ORDER BY pg_catalog.float_ops,
@@ -169,8 +168,7 @@ AS
169168
FUNCTION 3 rum_extract_tsquery(tsquery,internal,smallint,internal,internal,internal,internal),
170169
FUNCTION 4 rum_tsquery_timestamp_consistent(internal,smallint,tsvector,int,internal,internal,internal,internal),
171170
FUNCTION 5 gin_cmp_prefix(text,text,smallint,internal),
172-
FUNCTION 6 gin_tsquery_triconsistent(internal,smallint,tsvector,int,internal,internal,internal),
173-
FUNCTION 8 rum_tsquery_pre_consistent(internal,smallint,tsvector,int,internal,internal,internal,internal),
171+
FUNCTION 7 rum_tsquery_pre_consistent(internal,smallint,tsvector,int,internal,internal,internal,internal),
174172
STORAGE text;
175173

176174

rum.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -742,11 +742,11 @@ extern void rumInsertCleanup(RumState *rumstate,
742742
bool vac_delay, IndexBulkDeleteResult *stats);
743743

744744
/* rum_ts_utils.c */
745-
#define RUM_CONFIG_PROC 7
746-
#define RUM_PRE_CONSISTENT_PROC 8
747-
#define RUM_ORDERING_PROC 9
748-
#define RUM_OUTER_ORDERING_PROC 10
749-
#define RUMNProcs 10
745+
#define RUM_CONFIG_PROC 6
746+
#define RUM_PRE_CONSISTENT_PROC 7
747+
#define RUM_ORDERING_PROC 8
748+
#define RUM_OUTER_ORDERING_PROC 9
749+
#define RUMNProcs 9
750750

751751
extern Datum rum_extract_tsvector(PG_FUNCTION_ARGS);
752752
extern Datum rum_extract_tsquery(PG_FUNCTION_ARGS);

rumvalidate.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,6 @@ rumvalidate(Oid opclassoid)
135135
4, 4, opckeytype, opckeytype,
136136
INT2OID, INTERNALOID);
137137
break;
138-
case GIN_TRICONSISTENT_PROC:
139-
ok = check_amproc_signature(procform->amproc, CHAROID, false,
140-
7, 7, INTERNALOID, INT2OID,
141-
opcintype, INT4OID,
142-
INTERNALOID, INTERNALOID,
143-
INTERNALOID);
144-
break;
145138
case RUM_CONFIG_PROC:
146139
ok = check_amproc_signature(procform->amproc, VOIDOID, false,
147140
1, 1, INTERNALOID);
@@ -263,8 +256,8 @@ rumvalidate(Oid opclassoid)
263256
continue; /* got it */
264257
if (i == GIN_COMPARE_PARTIAL_PROC)
265258
continue; /* optional method */
266-
if (i == GIN_CONSISTENT_PROC || i == GIN_TRICONSISTENT_PROC)
267-
continue; /* don't need both, see check below loop */
259+
if (i == GIN_CONSISTENT_PROC)
260+
continue;
268261
if (i == RUM_PRE_CONSISTENT_PROC)
269262
continue;
270263
ereport(INFO,
@@ -274,18 +267,15 @@ rumvalidate(Oid opclassoid)
274267
result = false;
275268
}
276269
if (!opclassgroup ||
277-
((opclassgroup->functionset & (1 << GIN_CONSISTENT_PROC)) == 0 &&
278-
(opclassgroup->functionset & (1 << GIN_TRICONSISTENT_PROC)) == 0))
270+
(opclassgroup->functionset & (1 << GIN_CONSISTENT_PROC)) == 0)
279271
{
280272
ereport(INFO,
281273
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
282-
errmsg("rum opclass %s is missing support function %d or %d",
283-
opclassname,
284-
GIN_CONSISTENT_PROC, GIN_TRICONSISTENT_PROC)));
274+
errmsg("rum opclass %s is missing support function %d",
275+
opclassname, GIN_CONSISTENT_PROC)));
285276
result = false;
286277
}
287278

288-
289279
ReleaseCatCacheList(proclist);
290280
ReleaseCatCacheList(oprlist);
291281
ReleaseSysCache(familytup);

0 commit comments

Comments
 (0)