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@arlut.utexas.edu
Head of Sun Support, Sr. Operating Systems Specialist
Applied Research Labs, Computer Science Div. S224
University of Texas at Austin