Re: Multiple simultaneous queries on single connection

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Yeb Havinga <yeb(dot)havinga(at)portavita(dot)nl>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Multiple simultaneous queries on single connection
Date: 2009-08-19 01:35:30
Message-ID: 4A8B56E2.6050704@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2009-08-19 02:02:18 Re: [SQL] SQL Query Performance - what gives?
Previous Message Tim Landscheidt 2009-08-18 23:39:14 Re: FW: simple? query