Re: c-function returns multiple rows
От | Stephan Szabo |
---|---|
Тема | Re: c-function returns multiple rows |
Дата | |
Msg-id | 20030822061139.Y83860-100000@megazone.bigpanda.com обсуждение исходный текст |
Ответ на | c-function returns multiple rows (Kirill Krasnosselov <kirill@digicol.de>) |
Список | pgsql-novice |
On Fri, 22 Aug 2003, Kirill Krasnosselov wrote: > Hello, I have the following problem ( at PostgreSQL 7.3.3 on Red Hat > Linux 7.1) with c-functions returning multiple rows. > > Here is a transcript of the test example: > > ////////////////////////////////////////// > > #include <stdlib.h> > #include "postgres.h" > #include "fmgr.h" > #include "nodes/execnodes.h" > > > PG_FUNCTION_INFO_V1(dc_ftx); > Datum > dc_ftx(PG_FUNCTION_ARGS) > { ReturnSetInfo* rsi = (ReturnSetInfo *)fcinfo->resultinfo; > rsi->isDone = ExprEndResult; > PG_RETURN_NULL(); > } Looking at the docs, I'd think that should be: #include "postgres.h" #include "funcapi.h" PG_FUNCTION_INFO_V1(dc_ftx); Datum dc_ftx(PG_FUNCTION_ARGS) { FuncCallContext *funcctx; if (SRF_IS_FIRSTCALL()) { funcctx = SRF_FIRSTCALL_INIT(); } funcctx = SRF_PERCALL_SETUP(); SRF_RETURN_DONE(funcctx); } since I don't see a mention that creating the call context is optional, but I'm not a particular expert in the C interfact.
В списке pgsql-novice по дате отправления: