Re: C Set Returning Function (SRF)
| От | Tom Lane |
|---|---|
| Тема | Re: C Set Returning Function (SRF) |
| Дата | |
| Msg-id | 13911.1315459904@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | C Set Returning Function (SRF) (Gary Chambers <gwchamb@gwcmail.com>) |
| Ответы |
Re: C Set Returning Function (SRF)
|
| Список | pgsql-novice |
Gary Chambers <gwchamb@gwcmail.com> writes:
> I'm trying to write a simple set returning function that links the GNU pwgen
> code. I can't seem to pull it together to return the results reliably.
> There are several examples that demonstrate returning tuples, but I can't
> seem to find any examples of SRFs returning single (specifically textual)
> types. Will someone please offer some insight?
I think the problem is here:
> SRF_RETURN_NEXT(funcctx, CStringGetDatum(pw));
CStringGetDatum produces a datum of type cstring. You want a datum of
type text. PointerGetDatum(cstring_to_text(pw)) ought to do it.
regards, tom lane
В списке pgsql-novice по дате отправления: