libpq questuion - Mailing list pgsql-hackers

From Dmitry Samersoff
Subject libpq questuion
Date
Msg-id 199902081308.QAA10389@himera.wplus.net
Whole thread Raw
Responses Re: [HACKERS] libpq questuion
List pgsql-hackers
While update table whithin fetch forward loop 
cause infinite fetching of updated touple?

(code fragment below cause infinite 
displayng record with oid 20864)


----------------------------------------------------------------------------
PQexec(_conn, "BEGIN");
PQexec(_conn, "DECLARE curr1 CURSOR FOR select oid, name from domains;");

while(1)
{ _res = PQexec(_conn, "FETCH FORWARD 1 IN curr1");  if(  PQresultStatus(_res) != PGRES_TUPLES_OK ) break;
  PQexec(_conn, "update domains set type = 3 where oid = 20864" );  printf("oid: %s name: %s\n",
PQgetvalue(_res,0,0),PQgetvalue(_res,0,1));
}
---------------------------------------------------------------------------

-- 
Dmitry Samersoff
DM\S, dms@wplus.net, AIM: Samersoff
http://devnull.wplus.net



pgsql-hackers by date:

Previous
From: Oleg Broytmann
Date:
Subject: VACUUM ANALYZE problem on linux
Next
From: "Cary O'Brien"
Date:
Subject: Re: [HACKERS] Problems with >2GB tables on Linux 2.0