Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ezMaO-0004ys-PI for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Mar 2018 13:18:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ezMaN-0006WD-GZ for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Mar 2018 13:18:23 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ezMaM-0006W1-Sk for pgsql-hackers@lists.postgresql.org; Fri, 23 Mar 2018 13:18:23 +0000 Received: from mail.verite.pro ([185.16.44.216]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ezMaE-0003gG-1f for pgsql-hackers@postgresql.org; Fri, 23 Mar 2018 13:18:21 +0000 Received: from genius-map.net (verite.pro [195.154.189.246]) by mail.verite.pro (Postfix) with ESMTP id 798AD8C02AB; Fri, 23 Mar 2018 14:15:02 +0100 (CET) Received: by genius-map.net (Postfix, from userid 1001) id F0A3538A19FD; Fri, 23 Mar 2018 14:18:10 +0100 (CET) Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [HACKERS] PATCH: Batch/pipelining support for libpq From: "Daniel Verite" To: "Kyotaro HORIGUCHI" Cc: vaishnaviprabakaran@gmail.com,michael.paquier@gmail.com,daniel@yesql.se,craig@2ndquadrant.com,andres@anarazel.de,david@pgmasters.net,VaishnaviP@fast.au.fujitsu.com,kommi.haribabu@gmail.com,tsunakawa.takay@jp.fujitsu.com,dmitigr@gmail.com,pgsql-hackers@postgresql.org,m.kniep@web.de,fujita.etsuro@lab.ntt.co.jp,iwata.aya@jp.fujitsu.com In-Reply-To: <20180322.211148.187821341.horiguchi.kyotaro@lab.ntt.co.jp> Date: Fri, 23 Mar 2018 14:18:09 +0100 Message-Id: X-Mailer: Manitou v1.7.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Kyotaro HORIGUCHI wrote: > A disucssion on psql batch mode was held in another branch of > this thread. How do we treat that? There's a batch mode for pgbench in a patch posted in [1], with \beginbatch and \endbatch commands, but nothing for psql AFAICS. psql is more complicated because currently it uses a=20 blocking PQexec() call at its core. Craig mentioned psql integration in [2] and [3]. Also a script can have inter-query dependencies such as in insert into table(...) returning id \gset update othertable set col=3D :id where ...; which is a problem in batch mode, as we don't want to send the update before the right value for :id is known. Whether we want to support these dependencies and how needs discussion. For instance we might not support them at all, or create a synchronization command that collects all results of queries sent so far, or do it implicitly when a variable is injected into a query... This looks like substantial work that might be best done separately from the libpq patch. [1] https://www.postgresql.org/message-id/b4e34135-2bd9-4b8a-94ca-27d760da26d7@= manitou-mail.org [2] https://www.postgresql.org/message-id/CAMsr+YGLhaDkjymLuNVQy4MrSKQoA=3DF1vO= =3DaN8XQf30N=3DaQuVA@mail.gmail.com [3] https://www.postgresql.org/message-id/CAMsr+YE6BK4iAaQz=3DnY3xDnbLhnNZ_4tp-= PTJqbNNpsZMgoo8Q@mail.gmail.com Best regards, --=20 Daniel V=E9rit=E9 PostgreSQL-powered mailer: http://www.manitou-mail.org Twitter: @DanielVerite