Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id CA580632FA5 for ; Tue, 18 Aug 2009 22:36:08 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 82089-01 for ; Wed, 19 Aug 2009 01:36:01 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.postnewspapers.com.au (202-89-185-120.static.dsl.amnet.net.au [202.89.185.120]) by mail.postgresql.org (Postfix) with ESMTP id 89913632EE4 for ; Tue, 18 Aug 2009 22:36:00 -0300 (ADT) Received: from localhost (access [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id D7E101E0455; Wed, 19 Aug 2009 09:35:50 +0800 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (access.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hMZVNi1578rk; Wed, 19 Aug 2009 09:35:46 +0800 (WST) Received: from [10.1.1.6] (203-206-104-125.dyn.iinet.net.au [203.206.104.125]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTPSA id 4FEA21E0454; Wed, 19 Aug 2009 09:35:42 +0800 (WST) Message-ID: <4A8B56E2.6050704@postnewspapers.com.au> Date: Wed, 19 Aug 2009 09:35:30 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.1) Gecko/20090715 Thunderbird/3.0b3 MIME-Version: 1.0 To: Yeb Havinga CC: pgsql-sql@postgresql.org Subject: Re: Multiple simultaneous queries on single connection References: <4A8951C5.5030107@portavita.nl> In-Reply-To: <4A8951C5.5030107@portavita.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.74 tagged_above=-10 required=5 tests=BAYES_20=-0.74 X-Spam-Level: X-Archive-Number: 200908/97 X-Sequence-Number: 33006 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