PQsendQuery/ PQgetResult Problem

From: Usama Dar <munir(dot)usama(at)gmail(dot)com>
To: pgsql-hackers list <pgsql-hackers(at)postgresql(dot)org>
Subject: PQsendQuery/ PQgetResult Problem
Date: 2011-10-07 16:17:22
Message-ID: CAG4AQKiXE=cSVpKn-HKozCfBjSp+Tt6ZdAOeb1TJvPtPN1-KAw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Hackers,

I have a strange problem, or maybe it's not a strange problem but just
something wrong with my understanding i have SIP router which works with
postgresql using libpq, somewhere in the code it inserts a row in the
database and then when the insert is finished it invokes another module
which tries to read it , however sometimes the read operation doesn't find
the row which was just inserted, this happens if there are large number of
insert / read cycles like this are going on , the code which inserts the row
uses PQsendQuery to insert and waits for PQgetResult to return null before
the read module is invoked, the module which reads the row , reads it over a
new connection. My question is if PQgetResult returns null is this a good
enough guarantee that a subsequent connection (even in next millisecond)
should be able to read that row??

Thanks for making me wiser

/Usama

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-10-07 16:25:08 Re: [v9.2] make_greater_string() does not return a string in some cases
Previous Message Kohei KaiGai 2011-10-07 16:06:48 Re: WIP: Join push-down for foreign tables