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 1ghdQc-0004Wn-KG for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Jan 2019 16:43:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ghdQb-0003Ru-A9 for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Jan 2019 16:43:33 +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 1ghdQa-0003Rm-T4 for pgsql-hackers@lists.postgresql.org; Thu, 10 Jan 2019 16:43:33 +0000 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ghdQY-00061X-18 for pgsql-hackers@postgresql.org; Thu, 10 Jan 2019 16:43:32 +0000 Received: by mail-qt1-x842.google.com with SMTP id y20so13810109qtm.13 for ; Thu, 10 Jan 2019 08:43:29 -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=vdHZyuFgYE3Qg5PbVyhnjKEDWmBdyT5nqm14pcG1HZo=; b=nwTUhP6AjFgWhxHj1kHhlfTOW3rMpDr2zEGSLIlnz8ivVoGldAFEJINq8F4kMGaRem 3MxseITFkiVVnOL/uCDev0ZCsriLSj93HeNzteoC6LTOYpn3qONkr5crGcwT+eie2EY1 W8vbh1XqPGsAw58YKJVhGIxseBPcGHyS/9kpqKCRdEbXP10b/EsR3W4mP89q6Gjd75DU tpk9+JikkMi6mLmmq2h98a2/Jrw/O7/yHrYaiVsOlYTFQ7W9kxBBzmHdpmhMoBQi3rSp gLqDm5fxhGSTr+s9P6h+UFlIZNzk49WL5UzyBvIB5qZlopMpef91ulZeu18MoHiS0VBE 39cw== 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=vdHZyuFgYE3Qg5PbVyhnjKEDWmBdyT5nqm14pcG1HZo=; b=dk3TNYbs854b8oo3+Z4fgciQ4CoYmIagsQBhzoGsqtcJNi/5T8d0MKEAUidgut30hH NqZpYdYM+pReAgqNxx9e57gYS+teVxqdBQxDR0GolLCeLzPRrDJ1SG9UMKW+z69LBmNf GvFh9sqezuX4YEEZes91LQjzed6LzDGPGlFr3peQLr8IU7usF78mVvdliADYgfX5zlni LoPttMmegO+HfA7X1RJR7u64sx6xBggN5Ryw9wqtT4IZ0Bh9khfdv/Jwb33FkSO/RInJ 4XM9D5RdMwNPoCnchzIt+4CyZ/dHNUM8bfr1jo2JYNFeqneKRKOyL4DPMUBilAY3Xg3h yxCg== X-Gm-Message-State: AJcUukdLTiz5QZO5qMVD+jhxxLDgE1EeAqFuhidl/83pCZVtR/Rknr57 51GoSyUQcjPce7NdI3IuLUrSqefCu2MUPQ== X-Google-Smtp-Source: ALg8bN7buSCrd9JrTw8Yk/yZCsVDD2XQtKdjvhrGOcBTAU08ise+4aE6Qj1ZSsIwEpqMWhTW6KyI1A== X-Received: by 2002:a0c:c404:: with SMTP id r4mr10676941qvi.131.1547138608030; Thu, 10 Jan 2019 08:43:28 -0800 (PST) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id m68sm35921727qte.49.2019.01.10.08.43.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Jan 2019 08:43:27 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 6D4D8762; Thu, 10 Jan 2019 13:43:25 -0300 (-03) Date: Thu, 10 Jan 2019 13:43:25 -0300 From: Alvaro Herrera To: Fabien COELHO Cc: Michael Paquier , Stephen Frost , Andrew Dunstan , PostgreSQL Developers Subject: Re: [HACKERS] pgbench - allow to store select results into variables Message-ID: <201901101643.njjahixaycmn@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-1013-2c1e88 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Jan-10, Fabien COELHO wrote: > However, I switched "pg_free" to "termPQExpBuffer", which seems more > appropriate, even if it just does the same thing. I also ensured that > prefixes are allocated & freed. I've commented about expr which is not > freed. Oops, of course, thanks. > I'm not keen on having the command array size checked and updated *after* > the command is appended, even if the initial allocation ensures that there > is no overflow, but I let it as is. It was already done that way, only it was done in two places rather than one. I just refactored it. (In fairness, I think the assignment of the new command to the array could also be done in one place instead of two, but it seems slightly clearer like this.) > Attached a v29 with the above minor changes wrt your version. Thanks, pushed. I fixed a couple of very minor issues in the docs. Now let's see how the buildfarm likes this ... -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services