| От | Tom Lane |
|---|---|
| Тема | Re: Why my C function is called twice? |
| Дата | |
| Msg-id | 11700.1197433558@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Why my C function is called twice? ("Billow Gao" <billowgy@gmail.com>) |
| Список | pgsql-hackers |
"Billow Gao" <billowgy@gmail.com> writes:
> A very simple C function which I copied from the manual.
> And I found that it's called twice.
You do realize that it's *supposed* to be called twice? Once to
return the first row, and again to say it's done returning rows.
But the info messages you show are strange anyway. I tried your example
here and got the results I'd expect:
regression=# select * from retcomposite(1,48);
INFO: 1
INFO: 2
INFO: 3
INFO: 4
INFO: 2
INFO: 5f1 | f2 | f3
----+----+-----48 | 96 | 144
(1 row)
I think the code you showed must not quite match what you're actually
executing. Maybe you recompiled the code and forgot to do a LOAD or
start a fresh session to bring in the new .so file?
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера