libpq: why only one PQsendQuery per connection at a time?

From: sftf-misc(at)mail(dot)ru
To: pgsql-general(at)postgresql(dot)org
Subject: libpq: why only one PQsendQuery per connection at a time?
Date: 2015-01-04 16:02:11
Message-ID: 1382056210.20150104220211@mail.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello!
Question generally to (libpq) developers.

According to http://www.postgresql.org/docs/9.4/static/libpq-async.html:
"PQsendQuery cannot be called again (on the same connection) until PQgetResult
has returned a null pointer, indicating that the command is done."

As I guess this is also true for all PQsend* functions, like PQsendQueryPrepared,
although this is not explicitly stated in the documentation.

So question is why this limitaion exists?

Why PQgetResult(PGconn *conn) operates on connection,
and not on some unique handler that each "PQsend*" could return.

Is it limitaion of libpq or architecture of postgresql backend or backend-frontend protocol?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G Johnston 2015-01-04 17:45:38 Re: libpq: why only one PQsendQuery per connection at a time?
Previous Message Andreas Kretschmer 2015-01-04 15:36:20 Re: Streaming replication - slave not getting promoted