2426 Oid result = InvalidOid;
2430 Oid b2d_oid = postgis_oid(BOX2DFOID);
2431 Oid gdx_oid = postgis_oid(BOX3DOID);
2433 if (!(b2d_oid && gdx_oid))
2436 tbl_rel = RelationIdGetRelation(tbl_oid);
2437 idx_list = RelationGetIndexList(tbl_rel);
2438 RelationClose(tbl_rel);
2441 foreach(lc, idx_list)
2443 Form_pg_class idx_form;
2446 Oid idx_oid = lfirst_oid(lc);
2448 idx_tup = SearchSysCache1(RELOID, ObjectIdGetDatum(idx_oid));
2449 if (!HeapTupleIsValid(idx_tup))
2450 elog(ERROR,
"%s: unable to lookup index %u in syscache", __func__, idx_oid);
2451 idx_form = (Form_pg_class) GETSTRUCT(idx_tup);
2452 idx_relam = idx_form->relam;
2453 ReleaseSysCache(idx_tup);
2456 if (idx_relam == GIST_AM_OID)
2458 Form_pg_attribute att;
2461 HeapTuple att_tup = SearchSysCache2(ATTNAME,
2462 ObjectIdGetDatum(idx_oid),
2463 PointerGetDatum(colname));
2464 if (!HeapTupleIsValid(att_tup))
2467 att = (Form_pg_attribute) GETSTRUCT(att_tup);
2468 atttypid = att->atttypid;
2469 ReleaseSysCache(att_tup);
2472 if (b2d_oid == atttypid || gdx_oid == atttypid)
#define STATISTIC_SLOT_ND
#define STATISTIC_SLOT_2D
char * text_to_cstring(const text *textptr)