PQexec just spins. burns CPU, doesn't do anything.

From: "Jay G(dot) Scott" <gl(at)arlut(dot)utexas(dot)edu>
To: pgsql-novice(at)postgresql(dot)org
Subject: PQexec just spins. burns CPU, doesn't do anything.
Date: 2003-04-23 17:44:29
Message-ID: 200304231744.h3NHiTl23307@csdsun1.arlut.utexas.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


greetings,

found the currval function, thanks to all.

i have very similar C functions, each doing INSERTs.
One works, the other doesn't. I thought I was having
better luck with PQexec vs. PQsendQuery, but now....

the PQexec call goes off into la-la land. CPU burns
(I can see it in 'top' output), but it isn't returning.
truss shows nothing. so it's tied up in PQexec, somehow.
I obviously can't call PQresult or anything like that,
since I never return.

what do I do? i hesitate to post code. it's short, but....

i set postmaster to run at -d 3; it says:
LOG: query: SELECT m_id FROM machines WHERE hostname = 'yyy1'
LOG: parse tree:
{ QUERY :command 1 :source 0 :utility <> :resultRelation 0 :into <> :isPortal
false :isBinary false :hasAggs false :hasSubLinks false :rtable ({ RTE :alias
<> :eref { ALIAS :aliasname machines :colnames ( "m_id" "hostname" "os" )}
:rtekind 0 :relid 33480 :inh true :inFromCl true :checkForRead true
:checkForWrite false :checkAsUser 0}) :jointree { FROMEXPR :fromlist ({
RANGETBLREF 1 }) :quals { EXPR :typeOid 16 :opType op :oper { OPER :opno 1062
:opid 0 :opresulttype 16 :opretset false } :args ({ VAR :varno 1 :varattno 2
:vartype 1043 :vartypmod 84 :varlevelsup 0 :varnoold 1 :varoattno 2} { CONST
:consttype 1043 :constlen -1 :constbyval false :constisnull false :constvalue
8 [ 0 0 0 8 121 121 121 49 ] })}} :rowMarks () :targetList ({ TARGETENTRY
:resdom { RESDOM :resno 1 :restype 23 :restypmod -1 :resname m_id :reskey 0
:reskeyop 0 :ressortgroupref 0 :resjunk false } :expr { VAR :varno 1 :varattno
1 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold 1 :varoattno 1}})
:groupClause <> :havingQual <> :distinctClause <> :sortClause <> :limitOffset
<> :limitCount <> :setOperations <> :resultRelations ()}

DEBUG: ProcessQuery
DEBUG: CommitTransactionCommand
DEBUG: proc_exit(0)
DEBUG: shmem_exit(0)
DEBUG: exit(0)
DEBUG: BackendStartup: forked pid=2995 socket=9
DEBUG: reaping dead processes
DEBUG: child process (pid 2995) exited with exit code 0
DEBUG: proc_exit(0)
DEBUG: shmem_exit(0)
DEBUG: exit(0)
DEBUG: reaping dead processes
DEBUG: child process (pid 2996) exited with exit code 0
DEBUG: proc_exit(0)
DEBUG: shmem_exit(0)
DEBUG: exit(0)
DEBUG: reaping dead processes
DEBUG: child process (pid 3001) exited with exit code 0

A select occurs before the Insert is attempted. you can see the
select working. (i can see it in my debug printf's, too.)

i can't think of any other diagnostics i can do.

j.
--
Jay Scott 512-835-3553 gl(at)arlut(dot)utexas(dot)edu
Head of Sun Support, Sr. Operating Systems Specialist
Applied Research Labs, Computer Science Div. S224
University of Texas at Austin

Browse pgsql-novice by date

  From Date Subject
Next Message Chris Pizzo 2003-04-23 19:41:07 ERROR: XLogFlush:
Previous Message Knut P. Lehre 2003-04-23 15:54:08 subselects?