1092 GISTENTRY *entry_in = (GISTENTRY*)PG_GETARG_POINTER(0);
1093 GISTENTRY *entry_out = NULL;
1094 char gidxmem[GIDX_MAX_SIZE];
1095 GIDX *bbox_out = (GIDX*)gidxmem;
1099 POSTGIS_DEBUG(4,
"[GIST] 'compress' function called");
1105 if ( ! entry_in->leafkey )
1107 POSTGIS_DEBUG(4,
"[GIST] non-leafkey entry, returning input unaltered");
1108 PG_RETURN_POINTER(entry_in);
1111 POSTGIS_DEBUG(4,
"[GIST] processing leafkey input");
1112 entry_out = palloc(
sizeof(GISTENTRY));
1118 if ( DatumGetPointer(entry_in->key) == NULL )
1120 POSTGIS_DEBUG(4,
"[GIST] leafkey is null");
1121 gistentryinit(*entry_out, (Datum) 0, entry_in->rel,
1122 entry_in->page, entry_in->offset,
FALSE);
1123 POSTGIS_DEBUG(4,
"[GIST] returning copy of input");
1124 PG_RETURN_POINTER(entry_out);
1128 result = gserialized_datum_get_gidx_p(entry_in->key, bbox_out);
1134 POSTGIS_DEBUG(4,
"[GIST] empty geometry!");
1136 gistentryinit(*entry_out, PointerGetDatum(
gidx_copy(bbox_out)),
1137 entry_in->rel, entry_in->page,
1138 entry_in->offset,
FALSE);
1139 PG_RETURN_POINTER(entry_out);
1142 POSTGIS_DEBUGF(4,
"[GIST] got entry_in->key: %s", gidx_to_string(bbox_out));
1146 for ( i = 0; i < GIDX_NDIMS(bbox_out); i++ )
1148 if ( ! isfinite(GIDX_GET_MAX(bbox_out, i))
1149 || ! isfinite(GIDX_GET_MIN(bbox_out, i)) )
1152 gistentryinit(*entry_out,
1154 entry_in->rel, entry_in->page,
1155 entry_in->offset,
FALSE);
1156 PG_RETURN_POINTER(entry_out);
1164 gistentryinit(*entry_out, PointerGetDatum(
gidx_copy(bbox_out)),
1165 entry_in->rel, entry_in->page, entry_in->offset,
FALSE);
1168 POSTGIS_DEBUG(4,
"[GIST] 'compress' function complete");
1169 PG_RETURN_POINTER(entry_out);
static GIDX * gidx_copy(GIDX *b)
static void gidx_set_unknown(GIDX *a)
static void gidx_validate(GIDX *b)