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 1ljO2W-00072q-Fy for pgsql-bugs@arkaria.postgresql.org; Wed, 19 May 2021 15:23:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ljO2V-0006AH-Fq for pgsql-bugs@arkaria.postgresql.org; Wed, 19 May 2021 15:23:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ljO2V-0006A9-8o for pgsql-bugs@lists.postgresql.org; Wed, 19 May 2021 15:23:15 +0000 Received: from smtp13.smtpout.orange.fr ([80.12.242.135] helo=smtp.smtpout.orange.fr) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.92) (envelope-from ) id 1ljO2S-0000Ax-6g for pgsql-bugs@lists.postgresql.org; Wed, 19 May 2021 15:23:14 +0000 Received: from ERIADOR ([83.200.124.194]) by mwinf5d72 with ME id 6fP52500R4BmH7X03fP6hp; Wed, 19 May 2021 17:23:07 +0200 X-ME-Helo: ERIADOR X-ME-Auth: ZnJhbmNvaXMuZ3JhbmR2YXJsZXRAd2FuYWRvby5mcg== X-ME-Date: Wed, 19 May 2021 17:23:07 +0200 X-ME-IP: 83.200.124.194 From: To: "'Bruce Momjian'" , References: <17020-f5e23166506e7932@postgresql.org> <20210519143932.GA24077@momjian.us> In-Reply-To: <20210519143932.GA24077@momjian.us> Subject: RE: BUG #17020: meta command psql \reset does not clear the query buffer Date: Wed, 19 May 2021 17:23:06 +0200 Message-ID: <000001d74cc2$dec24900$9c46db00$@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJlEAUv3EpfftMuPtv2tRtsjRzO3QKWGHorqbq0UjA= Content-Language: fr List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thank you very much for your answer and your explanations. I should have read the doc more carefully. Best regards, Fran=E7ois Grandvarlet -----Message d'origine----- De=A0: Bruce Momjian =20 Envoy=E9=A0: mercredi 19 mai 2021 16:40 =C0=A0: francois.grandvarlet@wanadoo.fr; pgsql-bugs@lists.postgresql.org Objet=A0: Re: BUG #17020: meta command psql \reset does not clear the = query buffer On Tue, May 18, 2021 at 10:16:16PM +0000, PG Bug reporting form wrote: > The following bug has been logged on the website: >=20 > Bug reference: 17020 > Logged by: Fran=E7ois Grandvarlet > Email address: francois.grandvarlet@wanadoo.fr > PostgreSQL version: 13.3 > Operating system: Centos 7 > Description: =20 >=20 > 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=20 > buffer reset (cleared)." > but meta command \p still shows the query buffer and meta command \g=20 > execute the query Is this the normal behavior ? > It seems to me that the query buffer should be empty after issuing=20 > \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. --=20 Bruce Momjian https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion.