1162 GISTENTRY *entry = (GISTENTRY*) PG_GETARG_POINTER(0);
1163 Datum query_datum = PG_GETARG_DATUM(1);
1164 StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
1165 #if POSTGIS_PGSQL_VERSION >= 95 1166 bool *recheck = (
bool *) PG_GETARG_POINTER(4);
1168 char query_box_mem[GIDX_MAX_SIZE];
1169 GIDX *query_box = (GIDX*)query_box_mem;
1173 POSTGIS_DEBUGF(3,
"[GIST] '%s' function called", __func__);
1176 if ( strategy != 13 )
1178 elog(ERROR,
"unrecognized strategy number: %d", strategy);
1179 PG_RETURN_FLOAT8(FLT_MAX);
1183 if ( gserialized_datum_get_gidx_p(query_datum, query_box) ==
LW_FAILURE )
1185 POSTGIS_DEBUG(2,
"[GIST] null query_gbox_index!");
1186 PG_RETURN_FLOAT8(FLT_MAX);
1189 #if POSTGIS_PGSQL_VERSION >= 95 1191 if (GIST_LEAF(entry))
1198 entry_box = (GIDX*)DatumGetPointer(entry->key);
1206 POSTGIS_DEBUGF(2,
"[GIST] '%s' got distance %g", __func__, distance);
1208 PG_RETURN_FLOAT8(distance);
static double gidx_distance(const GIDX *a, const GIDX *b, int m_is_time)
Calculate the box->box distance.
Datum distance(PG_FUNCTION_ARGS)