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 1gNltb-0002DQ-Ld for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Nov 2018 21:43: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 1gNltY-0007cu-Dv for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Nov 2018 21:43:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gNltX-0007LZ-V2 for pgsql-hackers@lists.postgresql.org; Fri, 16 Nov 2018 21:43:20 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gNltQ-0002wm-BA for pgsql-hackers@postgresql.org; Fri, 16 Nov 2018 21:43:18 +0000 Received: by mail-qk1-x743.google.com with SMTP id d135so39826625qkc.12 for ; Fri, 16 Nov 2018 13:43:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=2YqGx2XUqfG1HsFp4GS+u7zmC9D2hphoniaI3AsQJyc=; b=Pf+hHFD+Nn7ZAMWrBR2eVCKZ2cQyZdU/AWQcyMXCBnwha+E1Bm8ebJFZjHCc+cijni ohpIZSaVGDsgjVQDxWwcLK8ERnGMVBNWdaHWEnXLpeKAaIYRgriH/hvXWCFkPuiC9gBU pOml960zxuvvfqTeumffO3vYaFoDHyAMWNbBe5iWSQngJEkUGQiZUvr8QZORZlcvXypu uLYXRAZpKvqrzfIRELprJ9o7/HCCTKaNacQeb/YunlXiAgA1TUWQP/PEpRPsnrBRWFnF 4a7aGpPAjK3m2bnB8EeNvS6phNLmEzE3UzkIJKQ1BYRHJI01veQBlLhxB96g704XHVEV azIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=2YqGx2XUqfG1HsFp4GS+u7zmC9D2hphoniaI3AsQJyc=; b=jsuPFA05EsPTlfune+0l3ouaO6I7ydQBgulZRcBi1m9SiU12Agvqx9NyuIF73Q8pju g/QdfC1QZOQWebNj35vhzElh46PZu+PZh8FHEuTb4bjqjvRoETKwDjJreAzqVxjCuTd3 JGRoG+mN0iXidmZfjAguiSQBrifY29CZ9NDRUOQl2hl/dgTVxkM7C/5C0y5SR580hTFE IuLfPvjdwuW/FS5Wb2tDyAFulPUIbfCqAFr6Oq4CuwCw6NMlPAXA1Izi7pZC6neuWMcd a1OJVKtHy2pxLPmCi6sY8tWhYTmTfuBiuHxCAcEq7ywvGlSsb0fxQfFRzZaQItSkPTy8 FjNw== X-Gm-Message-State: AGRZ1gIwxS37Nfl80OrHOkAqb+5CibdcEoqsgBCg/kvPuEpSBs1V/oDv PMZhhv+M8o2ISrvydePaU9JPfQ== X-Google-Smtp-Source: AJdET5d74k9zff/mZc06fxI0urfsmHt8/xHQjlwmFN1AcRADEuMD77hy6twx6uo8MjM61jvnAvfzyw== X-Received: by 2002:aed:3802:: with SMTP id j2mr12191354qte.146.1542404590904; Fri, 16 Nov 2018 13:43:10 -0800 (PST) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id q2sm3867405qkc.68.2018.11.16.13.43.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Nov 2018 13:43:10 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id C3FEF5BE; Fri, 16 Nov 2018 18:43:07 -0300 (-03) Date: Fri, 16 Nov 2018 18:43:07 -0300 From: Alvaro Herrera To: Fabien COELHO Cc: Pavel Stehule , Tatsuo Ishii , rafia.sabih@enterprisedb.com, Michael Paquier , Tom Lane , Amit Langote , Robert Haas , PostgreSQL Developers Subject: Re: [HACKERS] pgbench - allow to store select results into variables Message-ID: <20181116214307.uhpir3nvwuvjftxa@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2017-Nov-04, Fabien COELHO wrote: > Think of one initialization followed by two appends: > > SELECT 1 AS x \cset > SELECT 2 \; SELECT 3 AS y \cset > SELECT 4 \; SELECT 5 \; SELECT 6 AS z \gset > > In the end, we must have the full 6 queries > > "SELECT 1 AS x \; SELECT 2 \; SELECT 3 AS y \; SELECT 4 \; SELECT 5 \; SELECT 6 AS z" > > and know that we want to set variables from queries 1, 3 and 6 and ignore > the 3 others. I'm not sure I understand this. Why is the "SELECT 2" ignored? (I can see why the 4 and 5 are ignored: they are not processed by gset). What exactly does \cset do? I thought "SELECT 2 \; SELECT 3 AS y \cset" would search for the \; and process *both* queries. I think the doc addition should be split. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services