Puzzling behaviour running C Function

Поиск
Список
Период
Сортировка
От George Weaver
Тема Puzzling behaviour running C Function
Дата
Msg-id 003501c6540d$d8bf6dd0$6400a8c0@Dell4500
обсуждение исходный текст
Ответы Re: Puzzling behaviour running C Function
Список pgsql-novice
Hi,
 
I am running PostrgreSQL 8.1 on Win X/P.
 
I have written a function in C (my first) that performs a select followed by an update.
 
The function compiles properly, installs properly and works as expected.
 
However, if I start a new shell session and install the function and immediately call the function several times consecutively, after anywhere from 3 to 7 function calls the server disconnects:
 
        server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
        The connection to the server was lost. Attempting reset: Failed.
 
On the other hand, if I install the function, end the session, start a new session and call the function, I can literally call it  a 100 times without problem.
 
On a stripped down version of the function which simply performs the select, I found that this behaviour did not occur if FOR UPDATE was not included in the select statement, but in the full function, removing FOR UPDATE only prolonged the number of times I could run the function before the server disconnected.
 
Any idea what might be causing this?
   
Thanks,
George

В списке pgsql-novice по дате отправления:

Предыдущее
От: george young
Дата:
Сообщение: Re: Does a connection support multiple transactions.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Puzzling behaviour running C Function