Обсуждение: Hang in PQgetResult

Поиск
Список
Период
Сортировка

Hang in PQgetResult

От
"Ivetta Starikova"
Дата:
Hello,
I have a problem with my program that inserts records into postgreSQL
database.
After continuously running for several days, it suddenly hangs.  Attaching
with
gdb to a process gives the following stack trace.  It seems like a few
people
reported this problem but I haven't seen anyone suggest a steady solution.
In this post http://archives.postgresql.org/pgsql-bugs/2000-09/msg00062.php
it is suggested to call PQstatus(), before making PQexec().  So the idea is
to call PQstatus() and if it's not good to reconnect, right?
Please, help.
Thank you.

(gdb) where

#0  0x4013241e in select () from /lib/libc.so.6

#1  0x401cb980 in __DTOR_END__ () from /usr/idp/mgt-svr/lib/logActions/db.so

#2  0x401bf9e5 in pqWait (forRead=1, forWrite=0, conn=0x81f2318) at
fe-misc.c:782

#3  0x401bd9fd in PQgetResult (conn=0x81f2318) at fe-exec.c:1337

#4  0x401bdbe5 in PQexec (conn=0x81f2318,

    query=0xbfffe298 "INSERT INTO my_table VALUES (2, 1, 'no', 'no', 'no',
'no',"...)

    at fe-exec.c:1462

_________________________________________________________________
Get a FREE online computer virus scan from McAfee when you click here.
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

Re: Hang in PQgetResult

От
Tom Lane
Дата:
"Ivetta Starikova" <ivetta_s@hotmail.com> writes:
> I have a problem with my program that inserts records into postgreSQL
> database.
> After continuously running for several days, it suddenly hangs.

Looks to me like it's waiting for the server process.  Are you sure
there isn't some other operation blocking the INSERT (perhaps by
exclusively locking the table)?  If you're not sure what the server
is doing, try getting a stack trace from it.

            regards, tom lane