2436 Oid result = InvalidOid;
2440 Oid b2d_oid = postgis_oid(BOX2DFOID);
2441 Oid gdx_oid = postgis_oid(BOX3DOID);
2443 if (!(b2d_oid && gdx_oid))
2446 tbl_rel = RelationIdGetRelation(tbl_oid);
2447 idx_list = RelationGetIndexList(tbl_rel);
2448 RelationClose(tbl_rel);
2451 foreach(lc, idx_list)
2453 Form_pg_class idx_form;
2456 Oid idx_oid = lfirst_oid(lc);
2458 idx_tup = SearchSysCache1(RELOID, ObjectIdGetDatum(idx_oid));
2459 if (!HeapTupleIsValid(idx_tup))
2460 elog(ERROR,
"%s: unable to lookup index %u in syscache", __func__, idx_oid);
2461 idx_form = (Form_pg_class) GETSTRUCT(idx_tup);
2462 idx_relam = idx_form->relam;
2463 ReleaseSysCache(idx_tup);
2466 if (idx_relam == GIST_AM_OID)
2468 Form_pg_attribute att;
2472 HeapTuple att_tup = SearchSysCache2(ATTNAME,
2473 ObjectIdGetDatum(idx_oid),
2474 PointerGetDatum(colname));
2475 if (!HeapTupleIsValid(att_tup))
2478 att = (Form_pg_attribute) GETSTRUCT(att_tup);
2479 atttypid = att->atttypid;
2480 attnum = att->attnum;
2481 ReleaseSysCache(att_tup);
2484 if (b2d_oid == atttypid || gdx_oid == atttypid)
#define STATISTIC_SLOT_ND
#define STATISTIC_SLOT_2D
char * text_to_cstring(const text *textptr)