Re: Why my C function is called twice?

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [hensa22@yahoo.es: Re: [pgsql-es-ayuda] SLL error 100% cpu]
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: VLDB Features