Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNQaF-0008Lx-SX for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Jul 2016 20:16:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bNQaF-00031x-BC for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Jul 2016 20:16:39 +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.84_2) (envelope-from ) id 1bNQaE-00031h-Ku for pgsql-hackers@postgresql.org; Wed, 13 Jul 2016 20:16:38 +0000 Received: from boipeva.ensmp.fr ([194.214.158.136]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNQaB-00065j-LZ for pgsql-hackers@postgresql.org; Wed, 13 Jul 2016 20:16:37 +0000 Received: from cri.ensmp.fr (AGrenoble-653-1-69-83.w92-129.abo.wanadoo.fr [92.129.7.83]) (authenticated bits=0) by boipeva.ensmp.fr (8.15.2/8.15.1/JMMC-22/Oct/2013) with ESMTPSA id u6DKGP7E019881 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 13 Jul 2016 22:16:30 +0200 Date: Wed, 13 Jul 2016 22:16:25 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@sto To: Robert Haas cc: Pavel Stehule , PostgreSQL Developers Subject: Re: pgbench - allow to store select results into variables In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Miltered: at boipeva.ensmp.fr with ID 5786A199.000 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Auth: USER-ID fabien.coelho X-j-chkmail-Enveloppe: 5786A199.000 from AGrenoble-653-1-69-83.w92-129.abo.wanadoo.fr/AGrenoble-653-1-69-83.w92-129.abo.wanadoo.fr/92.129.7.83/cri.ensmp.fr/ X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Hello Robert, > I agree: I like \into. Great! > But: > >> SELECT 1, 2 \; SELECT 3; >> \into one two three > > I think that's pretty weird. I agree that it is weird, but I do not think that it is bad. Sending a batch of requests is a feature of libpq which is accessible through pgbench by using "\;", although the fact is not documented. It makes sense for a client to send independent queries together so as to reduce latency. From pgbench perspective, I would find it pretty weird as well that one can send several queries together but could only read the answer from... say the first one, and the others would be lost. From an implementation perspective doing it is straightforward, and rejecting it would require some more logic. An obvious nicer feature would be to allow intermixing \into & \; but ISTM that it would require to rethink deeply pgbench lexing/parsing which has just been merged with psql by Tom and others... If I had not pointed out the fact that it works, maybe no one would have noticed... so a compromise could be not to advertise the fact that it works (as the \; feature is not advertised anyway), but letting the implementation do it because it is simple and may be useful, and rephrase the documentation so that it is just about the previous select and not previous select*S*? -- Fabien. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers