| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Kirill Krasnosselov <kirill(at)digicol(dot)de> |
| Cc: | pgsql-novice(at)postgresql(dot)org |
| Subject: | Re: c-function returns multiple rows |
| Date: | 2003-08-22 13:52:28 |
| Message-ID: | 8918.1061560348@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
Kirill Krasnosselov <kirill(at)digicol(dot)de> writes:
> PG_FUNCTION_INFO_V1(dc_ftx);
> Datum
> dc_ftx(PG_FUNCTION_ARGS)
> { ReturnSetInfo* rsi = (ReturnSetInfo *)fcinfo->resultinfo;
> rsi->isDone = ExprEndResult;
> PG_RETURN_NULL();
> }
This looks like it should work, but you're living dangerously
by not checking that you're being called the way you expect.
You should have something like
if (!fcinfo->resultinfo || !IsA(fcinfo->resultinfo,ReturnSetInfo))
elog(ERROR, ...);
in there before trying to dereference the pointer.
> In my opinion this function call shall returns a empty table,
> but this call does not end.
Try attaching to the backend with a debugger to see what it's doing.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Luis Hernán Otegui | 2003-08-22 17:18:34 | Clusters and pgsql |
| Previous Message | Stephan Szabo | 2003-08-22 13:17:55 | Re: c-function returns multiple rows |