1093 GISTENTRY *entry_in = (GISTENTRY*)PG_GETARG_POINTER(0);
1094 GISTENTRY *entry_out = NULL;
1095 char gidxmem[GIDX_MAX_SIZE];
1096 GIDX *bbox_out = (GIDX*)gidxmem;
1100 POSTGIS_DEBUG(4,
"[GIST] 'compress' function called");
1106 if ( ! entry_in->leafkey )
1108 POSTGIS_DEBUG(4,
"[GIST] non-leafkey entry, returning input unaltered");
1109 PG_RETURN_POINTER(entry_in);
1112 POSTGIS_DEBUG(4,
"[GIST] processing leafkey input");
1113 entry_out = palloc(
sizeof(GISTENTRY));
1119 if ( DatumGetPointer(entry_in->key) == NULL )
1121 POSTGIS_DEBUG(4,
"[GIST] leafkey is null");
1122 gistentryinit(*entry_out, (Datum) 0, entry_in->rel,
1123 entry_in->page, entry_in->offset,
false);
1124 POSTGIS_DEBUG(4,
"[GIST] returning copy of input");
1125 PG_RETURN_POINTER(entry_out);
1129 result = gserialized_datum_get_gidx_p(entry_in->key, bbox_out);
1135 POSTGIS_DEBUG(4,
"[GIST] empty geometry!");
1137 gistentryinit(*entry_out, PointerGetDatum(
gidx_copy(bbox_out)),
1138 entry_in->rel, entry_in->page,
1139 entry_in->offset,
false);
1140 PG_RETURN_POINTER(entry_out);
1143 POSTGIS_DEBUGF(4,
"[GIST] got entry_in->key: %s", gidx_to_string(bbox_out));
1147 for ( i = 0; i < GIDX_NDIMS(bbox_out); i++ )
1149 if ( ! isfinite(GIDX_GET_MAX(bbox_out, i))
1150 || ! isfinite(GIDX_GET_MIN(bbox_out, i)) )
1153 gistentryinit(*entry_out,
1155 entry_in->rel, entry_in->page,
1156 entry_in->offset,
false);
1157 PG_RETURN_POINTER(entry_out);
1165 gistentryinit(*entry_out, PointerGetDatum(
gidx_copy(bbox_out)),
1166 entry_in->rel, entry_in->page, entry_in->offset,
false);
1169 POSTGIS_DEBUG(4,
"[GIST] 'compress' function complete");
1170 PG_RETURN_POINTER(entry_out);
static void gidx_set_unknown(GIDX *a)
GIDX * gidx_copy(GIDX *b)
void gidx_validate(GIDX *b)