From: Tom Lane <tgl@sss.pgh.pa.us>
To: francois.grandvarlet@wanadoo.fr
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17020: meta command psql \reset does not clear the query buffer
Date: Wed, 19 May 2021 10:42:39 -0400
Message-ID: <3429977.1621435359@sss.pgh.pa.us> (raw)
In-Reply-To: <17020-f5e23166506e7932@postgresql.org>
References: <17020-f5e23166506e7932@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> 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 ?
Yes. \p is documented as
Print the current query buffer to the standard output. If the current
query buffer is empty, the most recently executed query is printed
instead.
and \g likewise says "If the current query buffer is empty, the most
recently sent query is re-executed instead".
> It seems to me that the query buffer should be empty after issuing \reset
It is. If you now type something, that something is a new command that's
not concatenated with what you typed before.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, francois.grandvarlet@wanadoo.fr, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17020: meta command psql \reset does not clear the query buffer
In-Reply-To: <3429977.1621435359@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox