SRF_RETURN_NEXT Error: rows returned by function are not all of the same row type
Вложения
В списке pgsql-sql по дате отправления:
| От | amul sul |
|---|---|
| Тема | SRF_RETURN_NEXT Error: rows returned by function are not all of the same row type |
| Дата | |
| Msg-id | 1393224448.45554.YahooMailNeo@web193503.mail.sg3.yahoo.com обсуждение |
| Ответы |
Re: [NOVICE] SRF_RETURN_NEXT Error: rows returned by function are not all of the same row type
|
| Список | pgsql-sql |
Hi ALL,
I need little help, in writing C function returns multiple row. (please find attached c code: show_eudc.c)
I have created table & inserted values in "temp" as:
create table temp(id int, value varchar);
insert into temp select x, lpad('string', 10, x::text) from generate_series(1, 10) x;
Just want to return few rows SELECT * FROM temp using C function;
While setting funcctx->max_calls = 1 work as expected;
postgres=# select * from show_eudc();
NOTICE: call_cntr : 0
f1 | f2
----+------------
1 | 1111string
(1 row)
but setting funcctx->max_calls = 2;(or 4) throws error.
NOTICE: call_cntr : 0
NOTICE: call_cntr : 1
ERROR: rows returned by function are not all of the same row type
I am not getting cause of error, as it working for single call, but why not for multiple call?
Do i missing something?
Thanks in Advance
P.S. more info:
Loaded C function as:
CREATE OR REPLACE FUNCTION show_eudc(OUT f1 integer, OUT f2 varchar)
RETURNS SETOF record
AS 'MODULE_PATHNAME', 'show_eudc'
LANGUAGE C IMMUTABLE STRICT;
Regards,
Amul Sul
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера