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 1ljNMI-0005lu-Ul for pgsql-bugs@arkaria.postgresql.org; Wed, 19 May 2021 14:39:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ljNMH-00028w-Tz for pgsql-bugs@arkaria.postgresql.org; Wed, 19 May 2021 14:39:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ljNMH-00028o-Mm for pgsql-bugs@lists.postgresql.org; Wed, 19 May 2021 14:39:37 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ljNMF-0002aE-Cq for pgsql-bugs@lists.postgresql.org; Wed, 19 May 2021 14:39:37 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1ljNMC-0005CM-QR; Wed, 19 May 2021 10:39:32 -0400 Date: Wed, 19 May 2021 10:39:32 -0400 From: Bruce Momjian To: francois.grandvarlet@wanadoo.fr, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17020: meta command psql \reset does not clear the query buffer Message-ID: <20210519143932.GA24077@momjian.us> References: <17020-f5e23166506e7932@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <17020-f5e23166506e7932@postgresql.org> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, May 18, 2021 at 10:16:16PM +0000, PG Bug reporting form wrote: > The following bug has been logged on the website: > > Bug reference: 17020 > Logged by: François Grandvarlet > Email address: francois.grandvarlet@wanadoo.fr > PostgreSQL version: 13.3 > Operating system: Centos 7 > Description: > > Connected via psql > issuing a command like : SELECT * FROM generate_series (1, 1000); > meta command \p shows the query buffer > meta command \reset tells "Query buffer reset (cleared)." > but meta command \p still shows the query buffer and meta command \g execute > the query > Is this the normal behavior ? > It seems to me that the query buffer should be empty after issuing \reset I was recently confused by this too, but the psql \print documentation clarified it for me: \p or \print Print the current query buffer to the standard output. If the --> current query buffer is empty, the most recently executed query is --> printed instead. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion.