pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Yeb Havinga <yeb.havinga@portavita.nl>
To: Craig Ringer <craig@postnewspapers.com.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: Multiple simultaneous queries on single connection
Date: Wed, 19 Aug 2009 17:15:24 +0200
Message-ID: <4A8C170C.1050703@portavita.nl> (raw)
In-Reply-To: <4A8B56E2.6050704@postnewspapers.com.au>
References: <4A8951C5.5030107@portavita.nl>
	<4A8B56E2.6050704@postnewspapers.com.au>

Hello Craig, list
>> Is there a way to have two or more connections see each others
>> uncommitted things?
>
> Not at present.
>
> You should be able to use explicitly declared cursors and FETCH to 
> interleave requests for results from one or more queries in the same 
> transation using the one connection, but only one FETCH may be active 
> at a time.
Thanks for your info. I verified with a pl/pgsql function that from a 
pl/pgsql perspective, this is a good solution. However, our client 
application needs to access the postgres backend with libpq. I'm 
currently looking at PQsendPrepare / PQSendQueryPrepared together with 
what the exec_execute_message does. Each of these has a portal name as 
parameter. It would be nice if PQgetResult could also provide a portal 
name to fetch a result from. The question is how to multiplex data from 
different portals on the tcp/ip connection, or maybe have more than one 
tcp/ip connection per PQconn object when more than one portal is active 
at the same time.

--
Yeb




view thread (3+ messages)

Message-ID: <4A8C170C.1050703@portavita.nl>
Permalink:  ../4A8C170C.1050703@portavita.nl/
Also on:    postgresql.org/message-id/4A8C170C.1050703@portavita.nl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: yeb.havinga@portavita.nl, craig@postnewspapers.com.au
  Subject: Re: Multiple simultaneous queries on single connection
  In-Reply-To: <4A8C170C.1050703@portavita.nl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox