Received: from sonnet1.sonnet.com (sonnet.com [209.110.184.2]) by hub.org (8.9.3/8.9.3) with ESMTP id TAA26534 for ; Thu, 29 Jul 1999 19:40:45 -0400 (EDT) (envelope-from bcurnow@sonnet.com) Received: from sonnet.com (IDENT:root@ppp5-son.sonnet.com [209.110.185.2]) by sonnet1.sonnet.com (8.9.3/6.6.6) with ESMTP id QAA24766 for ; Thu, 29 Jul 1999 16:40:09 -0700 Sender: root@sonnet1.sonnet.com Message-ID: <37A0E659.5F423AA8@sonnet.com> Date: Thu, 29 Jul 1999 16:40:09 -0700 From: Brian Curnow X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.9 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: perl5 Should consumeInput obliterate unretrieved Notifys? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello, I've got a Perl script that makes the following series of calls: conn->exec(SELECT ... conn->exec(UPDATE ... $conn->socket select (..) [with short timeout] conn->consumeInput conn->notifies What I am seeing is that if a Notify arrives between the SELECT and UPDATE, the exec(UPDATE) call consumes the notify, and when the next consumeInput is eventually called, the notify disappears. The easy fix is obviously to call notifies() before even starting the select(), but I wonder if the loss of notify is correct. The docs for libpq state that you should call notifies() after each PQexec or PQgetResult, but I figured that was because a future select() would not catch the notify since PQexec already had read it, and you might wait (possibly forever) without checking. Further up in the documentation, it states "Once a notification is returned from PQnotifies, it is considered handled and will be removed from the list of notifications." which would imply the loss of the notify is incorrect. perldoc Pg doesn't say anything contradictory. Does anyone have thoughts on this? Brian Curnow