914 GISTENTRY *entry_in = (GISTENTRY *)PG_GETARG_POINTER(0);
915 GISTENTRY *entry_out = NULL;
916 char gidxmem[GIDX_MAX_SIZE];
917 GIDX *bbox_out = (GIDX *)gidxmem;
921 POSTGIS_DEBUG(4,
"[GIST] 'compress' function called");
927 if (!entry_in->leafkey)
929 POSTGIS_DEBUG(4,
"[GIST] non-leafkey entry, returning input unaltered");
930 PG_RETURN_POINTER(entry_in);
933 POSTGIS_DEBUG(4,
"[GIST] processing leafkey input");
934 entry_out = palloc(
sizeof(GISTENTRY));
940 if (!DatumGetPointer(entry_in->key))
942 POSTGIS_DEBUG(4,
"[GIST] leafkey is null");
943 gistentryinit(*entry_out, (Datum)0, entry_in->rel, entry_in->page, entry_in->offset,
false);
944 POSTGIS_DEBUG(4,
"[GIST] returning copy of input");
945 PG_RETURN_POINTER(entry_out);
949 result = gserialized_datum_get_gidx_p(entry_in->key, bbox_out);
955 POSTGIS_DEBUG(4,
"[GIST] empty geometry!");
957 gistentryinit(*entry_out,
963 PG_RETURN_POINTER(entry_out);
966 POSTGIS_DEBUGF(4,
"[GIST] got entry_in->key: %s", gidx_to_string(bbox_out));
971 for (i = 0; i < GIDX_NDIMS(bbox_out); i++)
973 if (!isfinite(GIDX_GET_MAX(bbox_out, i)) || !isfinite(GIDX_GET_MIN(bbox_out, i)))
976 gistentryinit(*entry_out,
982 PG_RETURN_POINTER(entry_out);
991 *entry_out, PointerGetDatum(
gidx_copy(bbox_out)), entry_in->rel, entry_in->page, entry_in->offset,
false);
994 POSTGIS_DEBUG(4,
"[GIST] 'compress' function complete");
995 PG_RETURN_POINTER(entry_out);
void gidx_set_unknown(GIDX *a)
GIDX * gidx_copy(GIDX *b)
void gidx_validate(GIDX *b)