From: Craig Ringer <craig@postnewspapers.com.au>
To: Yeb Havinga <yeb.havinga@portavita.nl>
Cc: pgsql-sql@postgresql.org
Subject: Re: Multiple simultaneous queries on single connection
Date: Wed, 19 Aug 2009 09:35:30 +0800
Message-ID: <4A8B56E2.6050704@postnewspapers.com.au> (raw)
In-Reply-To: <4A8951C5.5030107@portavita.nl>
References: <4A8951C5.5030107@portavita.nl>
On 17/08/2009 8:49 PM, Yeb Havinga wrote:
> Hello list,
>
> We want to access a postgres database with multiple queries / result
> sets that are read simultaneously (hence async). The documentation says
> explicitly that no new PQsendQuery can be send on the same channel
> before the pqgetresults has returned null. This means we need to use
> multiple connections.
>
> The problem is that multiple connections (from the same application
> instance) do not share the same MVCC snapshot.
>
> 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.
--
Craig Ringer
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: craig@postnewspapers.com.au, yeb.havinga@portavita.nl
Subject: Re: Multiple simultaneous queries on single connection
In-Reply-To: <4A8B56E2.6050704@postnewspapers.com.au>
* 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