Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 7F8581337B8A for ; Wed, 8 Dec 2010 09:40:53 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 94339-04 for ; Wed, 8 Dec 2010 13:40:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from hogranch.com (hogranch.com [75.101.82.47]) by mail.postgresql.org (Postfix) with ESMTP id 9D3CD1337B92 for ; Wed, 8 Dec 2010 09:40:45 -0400 (AST) Received: from [127.0.0.1] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id oB8Debn11334 for ; Wed, 8 Dec 2010 05:40:37 -0800 Message-ID: <4CFF8AD0.5080602@hogranch.com> Date: Wed, 08 Dec 2010 05:40:32 -0800 From: John R Pierce User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101027 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: PostgreSQL Subject: Re: Asynchronous query execution References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201012/263 X-Sequence-Number: 170554 On 12/08/10 5:35 AM, c k wrote: > Hello, > I would like to know how can we execute the queries asynchronously? > If we use and execute plpgsql functions they just completes the > execution or throws an error on error. In between next sql statement > waits for the previous one to complete the execution. But in few > situations it is required not to wait for getting the completion of > previous sql statement. How can this e achieved? > one postgresql connection can only run one query at a time. run your asynchronous queries from a thread with its own connection