Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hDDMT-0000oY-MM for pgsql-general@arkaria.postgresql.org; Sun, 07 Apr 2019 19:21:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hDDMS-00020s-5t for pgsql-general@arkaria.postgresql.org; Sun, 07 Apr 2019 19:21:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hDDMQ-00020l-08 for pgsql-general@lists.postgresql.org; Sun, 07 Apr 2019 19:21:47 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hDDMH-0000pc-5f for pgsql-general@postgresql.org; Sun, 07 Apr 2019 19:21:45 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 812D221BF9; Sun, 7 Apr 2019 15:21:35 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 07 Apr 2019 15:21:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=fm1; bh=K 2CLqC9cevTqDVPTichJhuqxs5JsRZAi9rmGBdpYOOk=; b=SfxFKomJw2AyQhUvj 3QJ/zcosFRr5MVJE+OOsyCx6PGbUbJ0ngRs44QLs5iVxbq1bGzfzyjnDI8Ala1vj tSD+2Mk9JN3p9+f1uMJchLAQRGhflPkNGk7keL8X8qRZof8Yzrv0ZQchnw/h3HPt IxA87W2GvXXq1f8T1QZyeGqmM92K2ZBhC0VMVGbECdVXpdEh81bPDgup5ClkIu2f 0/RlUEeby9heyVQQKFvzO/xpDq7yAf3zmlSle5f4v8lVk/jKc3C3eZkByZelqMyp amdB01KL7givyUZJxvIrTR93aTIDl1w2vKsSjfsUmWOp1UNvZ6kPvRk3dBRO/xDp Fo6tg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=K2CLqC9cevTqDVPTichJhuqxs5JsRZAi9rmGBdpYO Ok=; b=Mkps7esIKo+T0Y3KLPbmIk/TgtWGgIKuc/ZdYJL3Q6mYdIBV3g/YbK30l rvZQLHjS3aH6zlAoy6Shw/dHUkJMBvp8pCULP8yP4Ej26XvXKd+TBeXc2xUVyGEg a2Ma+Y+qXmOPWXHCJ3f3aGiMx5QJAU46uaQg3oTEJ+YbyqNhmqZS7rUR+4PcSzcx gDdkIoFQYXlTTleujS1/Hkn9q+YpMswOocxhxyVuVYI5T9BXdkRQGY7dzFddb33z 8aE7EQHt4bI13yNWtMSf7Juy321YEyj95nvwcgfltPCMre48ikBXFrTI1WHy6TET LH+GuEQzfDrS+uRor5JeMguPDcUkA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddruddugddufeehucdltddurdeguddtrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepfffhvffukfhfgggtugfgjgesthekredttddt udenucfhrhhomheptehnughrvghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrg iivghlrdguvgeqnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenucfkphep leekrddvuddtrddugedtrddujedunecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurh gvshesrghnrghrrgiivghlrdguvgenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id 0A2D0E45F3; Sun, 7 Apr 2019 15:21:35 -0400 (EDT) Date: Sun, 7 Apr 2019 12:21:33 -0700 From: Andres Freund To: Pavel Stehule Cc: Konstantin Izmailov , "pgsql-general@postgresql.org" Subject: Re: assembling PGresults from multiple simultaneous queries (libpq, singlerowmode) Message-ID: <20190407192133.5nmrwme2ritudilj@alap3.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2019-04-07 20:57:56 +0200, Pavel Stehule wrote: > ne 7. 4. 2019 v 20:47 odesílatel Konstantin Izmailov > napsal: > > > Hi, > > I'm experimenting with Postgres 10 and protocol v3. I noticed that the > > Postgres allows executing multiple queries simultaneously (I basically > > commented out a check that prevents sending another query in libpq while > > previous result(s) reading is not complete). Things appear like working, > > but I just wanted to ask if anyone else tried the same (logically separate > > results from multiple simultaneous queries)? > > > > > Postgres cannot to execute simultaneous queries in one session. So queries > should be executed in serial form every time. I think what Konstantin is really talking about is pipelining (i.e. sending multiple queries without waiting for the results inbetween, thereby reducing latency), and that is actually supported by postgres. Some drivers make fairly extensive use of it (e.g. the pgjdbc driver). As for libpq: No, that's currently not supported. There is a patch that I hope to get into v13 however: https://commitfest.postgresql.org/20/1317 Greetings, Andres Freund