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

◆ _postgis_gserialized_index_extent()

Datum _postgis_gserialized_index_extent ( PG_FUNCTION_ARGS  )

Definition at line 2375 of file gserialized_estimate.c.

2376{
2377 GBOX *gbox = NULL;
2378 int key_type;
2379 int16 att_num, idx_att_num = InvalidAttrNumber;
2380 Oid tbl_oid = PG_GETARG_DATUM(0);
2381 char *col = text_to_cstring(PG_GETARG_TEXT_P(1));
2382 Oid idx_oid;
2383
2384 if(!tbl_oid)
2385 PG_RETURN_NULL();
2386
2387 /* We need to initialize the internal cache to access it later via postgis_oid() */
2388 postgis_initialize_cache();
2389
2390 att_num = get_attnum(tbl_oid, col);
2391 if (att_num == InvalidAttrNumber)
2392 PG_RETURN_NULL();
2393
2394 idx_oid = table_get_spatial_index(tbl_oid, att_num, &key_type, &idx_att_num);
2395 if (!idx_oid)
2396 PG_RETURN_NULL();
2397
2398 gbox = spatial_index_read_extent(idx_oid, idx_att_num, key_type);
2399 if (!gbox)
2400 PG_RETURN_NULL();
2401 else
2402 PG_RETURN_POINTER(gbox);
2403}
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: