PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ _postgis_gserialized_index_extent()

Datum _postgis_gserialized_index_extent ( PG_FUNCTION_ARGS  )

Definition at line 2533 of file gserialized_estimate.c.

2534 {
2535  GBOX *gbox = NULL;
2536  int key_type;
2537  int16 att_num, idx_att_num = InvalidAttrNumber;
2538  Oid tbl_oid = PG_GETARG_DATUM(0);
2539  char *col = text_to_cstring(PG_GETARG_TEXT_P(1));
2540  Oid idx_oid;
2541 
2542  if(!tbl_oid)
2543  PG_RETURN_NULL();
2544 
2545  /* We need to initialize the internal cache to access it later via postgis_oid() */
2546  postgis_initialize_cache();
2547 
2548  att_num = get_attnum(tbl_oid, col);
2549  if (att_num == InvalidAttrNumber)
2550  PG_RETURN_NULL();
2551 
2552  idx_oid = table_get_spatial_index(tbl_oid, att_num, &key_type, &idx_att_num);
2553  if (!idx_oid)
2554  PG_RETURN_NULL();
2555 
2556  gbox = spatial_index_read_extent(idx_oid, idx_att_num, key_type);
2557  if (!gbox)
2558  PG_RETURN_NULL();
2559  else
2560  PG_RETURN_POINTER(gbox);
2561 }
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: