56 uint32_t natts = (uint32_t) tupdesc->natts;
57 char **keys = palloc(natts *
sizeof(*keys));
59 bool geom_found =
false;
60 for (i = 0; i < natts; i++) {
61 Oid typoid = getBaseType(TupleDescAttr(tupdesc, i)->atttypid);
62 char *tkey = TupleDescAttr(tupdesc, i)->attname.data;
63 char *key = pstrdup(tkey);
65 if (!geom_found && typoid == postgis_oid(GEOMETRYOID)) {
71 if (!geom_found && strcmp(key, ctx->
geom_name) == 0) {
80 elog(ERROR,
"encode_keys: no geometry column found");
81 ctx->
data->n_keys = k;
82 ctx->
data->keys = keys;
83 ReleaseTupleDesc(tupdesc);
static TupleDesc get_tuple_desc(struct geobuf_agg_context *ctx)