55 int natts = tupdesc->natts;
56 char **keys = palloc(natts *
sizeof(*keys));
58 bool geom_found =
false;
59 for (i = 0; i < natts; i++) {
60 #if POSTGIS_PGSQL_VERSION < 110 61 Oid typoid = getBaseType(tupdesc->attrs[i]->atttypid);
62 char *tkey = tupdesc->attrs[i]->attname.data;
64 Oid typoid = getBaseType(tupdesc->attrs[i].atttypid);
65 char *tkey = tupdesc->attrs[i].attname.data;
67 char *key = palloc(strlen(tkey) + 1);
70 if (!geom_found && typoid == postgis_oid(GEOMETRYOID)) {
76 if (!geom_found && strcmp(key, ctx->
geom_name) == 0) {
85 elog(ERROR,
"encode_keys: no geometry column found");
86 ctx->
data->n_keys = k;
87 ctx->
data->keys = keys;
88 ReleaseTupleDesc(tupdesc);
static TupleDesc get_tuple_desc(struct geobuf_agg_context *ctx)