Re: [GENERAL] Return setof values from C-function

2013-12-11 Thread Yuriy Rusinov
I have received an error The connection to the server was lost. Attempting reset: Failed This problem was solved using by C-strings instead of Datum such as FuncCallContext *funcctx; int call_cntr; int max_calls; AttInMetadata *attinmeta; unsigned long il; TupleDesc tupde

Re: [GENERAL] Return setof values from C-function

2013-12-10 Thread Merlin Moncure
On Tue, Dec 10, 2013 at 9:44 AM, Yuriy Rusinov wrote: > I have added code > > Oid * oids = (Oid *)palloc (2*sizeof (Oid)); > oids[0] = INT8OID; > oids[1] = FLOAT8OID; > if (get_call_result_type(fcinfo, oids, &tupdescRes) != > TYPEFUNC_COMPOSITE) > erepor

Re: [GENERAL] Return setof values from C-function

2013-12-10 Thread Yuriy Rusinov
I have added code Oid * oids = (Oid *)palloc (2*sizeof (Oid)); oids[0] = INT8OID; oids[1] = FLOAT8OID; if (get_call_result_type(fcinfo, oids, &tupdescRes) != TYPEFUNC_COMPOSITE) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),

Re: [GENERAL] Return setof values from C-function

2013-12-10 Thread Merlin Moncure
On Tue, Dec 10, 2013 at 1:30 AM, Yuriy Rusinov wrote: > Dear Colleagues ! > > I have to return setof values from C-function > > I wrote > > FuncCallContext *funcctx; > int call_cntr; > int max_calls; > AttInMetadata *attinmeta; > unsigned long il; > if (SRF_IS_FIRSTCALL())

[GENERAL] Return setof values from C-function

2013-12-09 Thread Yuriy Rusinov
Dear Colleagues ! I have to return setof values from C-function I wrote FuncCallContext *funcctx; int call_cntr; int max_calls; AttInMetadata *attinmeta; unsigned long il; if (SRF_IS_FIRSTCALL()) { MemoryContext oldcontext; funcctx = SRF_FIRSTCALL_IN