Skip site navigation (1) Skip section navigation (2)

active queries

From: Miklosi Attila <amiklosi(at)freemail(dot)hu>
To: pgsql-general(at)postgresql(dot)org
Subject: active queries
Date: 2008-05-27 09:35:49
Message-ID: 1211880949.6156.27.camel@develop3-linux (view raw, whole thread or download thread mbox)
Lists: pgsql-general

Our company has a long last problem by using libpq in multi-threaded
programs. The libpq usually closes the programs without any error
message or rarely giving the 'Invalid frontend message type 87' error.
When asked you about this error message you gave the reply below. In the
reply there is only one thing which is not clear... What does an
'active' query mean? Or how can we detect active queries on a PGconn?
We have tried PQcancel() and PQreset() functions too, but they didn't
help solving the problem.
Our programs retrieve every result (PQgetResult() and PQclear()
functions) that is pending on the server before reusing a PGconn.

Thank you in advance
Attila Miklosi

P.S.: this is a copy of your reply to 'invalid frontend message type 87'
error message

>"Invalid frontend message" means the server got a message with an
>unexpected first byte, which usually means the server and libpq got
>out of sync about where the message boundaries are.  It's been quite
>a long time since we've seen an actual bug of that sort, though.
>The cases that I've heard of recently involve multiple threads in an
>application trying to use the same PGconn without any interlocking.
>You can't have multiple queries active on a single connection, but
>libpq itself doesn't contain any locking to prevent multiple threads
>from trying to use the PGconn at once.
>If you're getting this with a single-threaded client, please submit
>a test case to pgsql-bugs.
>                       regards, tom lane


pgsql-general by date

Next:From: Justin CliftDate: 2008-05-27 11:12:53
Subject: New MS patent: sounds like PG db rules
Previous:From: Teodor SigaevDate: 2008-05-27 09:30:51
Subject: Re: [GENERAL] Fragments in tsearch2 headline

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group