46 MemoryContext aggcontext, oldcontext;
47 char *geom_name = NULL;
51 POSTGIS_DEBUG(2,
"calling pgis_asflatgeobuf_transfn");
54 postgis_initialize_cache();
56 if (!AggCheckCallContext(fcinfo, &aggcontext))
57 elog(ERROR,
"pgis_asflatgeobuf_transfn: called in non-aggregate context");
58 oldcontext = MemoryContextSwitchTo(aggcontext);
60 if (PG_ARGISNULL(0)) {
61 if (PG_NARGS() > 2 && !PG_ARGISNULL(2))
63 if (PG_NARGS() > 3 && !PG_ARGISNULL(3))
64 geom_name = text_to_cstring(PG_GETARG_TEXT_P(3));
70 if (!type_is_rowtype(get_fn_expr_argtype(fcinfo->flinfo, 1)))
71 elog(ERROR,
"pgis_asflatgeobuf_transfn: parameter row cannot be other than a rowtype");
72 ctx->
row = PG_GETARG_HEAPTUPLEHEADER(1);
75 MemoryContextSwitchTo(oldcontext);
76 PG_RETURN_POINTER(ctx);
static int create_index(const char *schema, const char *table, const char *column, const char *tablespace, STRINGBUFFER *buffer)