PostGIS 3.6.2dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ _postgis_gserialized_index_extent()

Datum _postgis_gserialized_index_extent ( PG_FUNCTION_ARGS  )

Definition at line 2379 of file gserialized_estimate.c.

2380{
2381 GBOX *gbox = NULL;
2382 int key_type;
2383 int16 att_num, idx_att_num = InvalidAttrNumber;
2384 Oid tbl_oid = PG_GETARG_DATUM(0);
2385 char *col = text_to_cstring(PG_GETARG_TEXT_P(1));
2386 Oid idx_oid;
2387
2388 if(!tbl_oid)
2389 PG_RETURN_NULL();
2390
2391 /* We need to initialize the internal cache to access it later via postgis_oid() */
2392 postgis_initialize_cache();
2393
2394 att_num = get_attnum(tbl_oid, col);
2395 if (att_num == InvalidAttrNumber)
2396 PG_RETURN_NULL();
2397
2398 idx_oid = table_get_spatial_index(tbl_oid, att_num, &key_type, &idx_att_num);
2399 if (!idx_oid)
2400 PG_RETURN_NULL();
2401
2402 gbox = spatial_index_read_extent(idx_oid, idx_att_num, key_type);
2403 if (!gbox)
2404 PG_RETURN_NULL();
2405 else
2406 PG_RETURN_POINTER(gbox);
2407}
static GBOX * spatial_index_read_extent(Oid idx_oid, int idx_att_num, int key_type)
static Oid table_get_spatial_index(Oid tbl_oid, int16 attnum, int *key_type, int16 *idx_attnum)

References spatial_index_read_extent(), and table_get_spatial_index().

Here is the call graph for this function: