Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l9zH3-0008Mg-Ma for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Feb 2021 23:51:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l9zH2-0006bV-KT for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Feb 2021 23:51:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l9zH1-0006bO-PG for pgsql-hackers@lists.postgresql.org; Wed, 10 Feb 2021 23:51:56 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l9zGz-0005Ps-ER for pgsql-hackers@lists.postgresql.org; Wed, 10 Feb 2021 23:51:54 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 59DD0BE8; Wed, 10 Feb 2021 18:51:51 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 10 Feb 2021 18:51:51 -0500 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:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=2U0WKZpJu0fLxNpmYUgpfOxUP/eUvnmMxby0yi3Pxew=; b=AIVbrnlT Sqx59vkrimXrJN3XxmMAYSMOYUk2g9+YCfqrVSz0G4oPrEB2lI5LndWahoScYKlb XzETk3s0d0TehPswcSNZltXxL+f8OZhW9YXkDmnFoGdckk/f4056zwt6e3ESb7u7 x/EkR1aokEJ8jWV6zViXFdsqVXr1aG52Wgql0/K3jMfhamBwjhjXQToTmToZqUAE x/lgKO8s8X2goPjBEbFSBJqdhlDxLGs2am6iU6pMvBYsg3a1y/gT2jZ/j8stf29i kdzt1tDxmL5hS4M/NMEWqsZXgqzq1kdHtxkxQ93mu5nWzNYh4FmsXL6uau1eCwse bsOjMp29hgwYew== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrheekgdduhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtugfgjggfsehtkeertddtredunecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeeufffhjeeiueeuffegvddukeegledtveeivdeiueefieei vefgteehueefteehvdenucfkphepudeltddrleehrdduledrudejjeenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghl vhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.177]) by mail.messagingengine.com (Postfix) with ESMTPA id 7BE34108005B; Wed, 10 Feb 2021 18:51:50 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 8F34A2A0FEA; Wed, 10 Feb 2021 20:51:47 -0300 (-03) Date: Wed, 10 Feb 2021 20:51:47 -0300 From: Alvaro Herrera To: Craig Ringer Cc: Matthieu Garrigues , PostgreSQL-development Subject: Re: PATCH: Batch/pipelining support for libpq Message-ID: <20210210235147.GA32273@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210121234326.GA18684@alvherre.pgsql> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2021-Jan-21, Alvaro Herrera wrote: > As you can see in an XXX comment in the libpq test program, the current > implementation has the behavior that PQgetResult() returns NULL after a > batch is finished and has reported PGRES_BATCH_END. I don't know if > there's a hard reason to do that, but I'd like to supress it because it > seems weird and out of place. Hello Craig, a question for you since this API is your devising. I've been looking at changing the way this works to prevent those NULL returns from PQgetResult. That is, instead of having what seems like a "NULL separator" of query results, you'd just get the PGRES_BATCH_END to signify a batch end (not a NULL result after the BATCH_END); and the normal PGRES_COMMAND_OK or PGRES_TUPLES_OK etc when the result of a command has been sent. It's not working yet so I'm not sending an updated patch, but I wanted to know if you had a rationale for including this NULL return "separator" or was it just a convenience because of how the code grew together. Such a decision has obvious consequences for the test program (which right now expects that PQgetResult() returns NULL at each step); and naturally for libpq's internal state machine that controls how it all works. Thanks, -- Álvaro Herrera 39°49'30"S 73°17'W