Search Postgresql Archives

Handling error during async query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I'm trying to fix psycopg2 issue #113: network disconnection not
handled correctly in async mode.

If I'm in the middle between the PQsendQuery and the PQgetResult and
an error is detected (let's say we don't know yet if
application-related or connection-related), is there a way to abort
the query and put it back in a status where PQsendQuery can be
executed again (I believe transaction status from ACTIVE to IDLE)
without fetching the result?

Psycopg currently tries to fetch (blocking) and discard the result
after an error:

    while (NULL != (res = PQgetResult(conn->pgconn))) {
        PQclear(res);
    }

but if the network connection has gone down it will result in waiting
forever. Not to mention the fact the operation is blocking when the
user wanted nonblocking operations.


-- Daniele

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux