pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavlo Golub <pavlo.golub@cybertec.at>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16034: `\set ECHO all` doesn't work for \e command
Date: Wed, 02 Oct 2019 12:51:47 -0400
Message-ID: <10221.1570035107@sss.pgh.pa.us> (raw)
In-Reply-To: <CAK7ymcLvRGwjHXdvQX7eJVLS3SigmuvAxLWex+xz3ciEJqizqQ@mail.gmail.com>
References: <16034-a7ebf0622970a1dd@postgresql.org>
	<7946.1570031807@sss.pgh.pa.us>
	<CAK7ymcLvRGwjHXdvQX7eJVLS3SigmuvAxLWex+xz3ciEJqizqQ@mail.gmail.com>

Pavlo Golub <pavlo.golub@cybertec.at> writes:
> On Wed, Oct 2, 2019 at 5:56 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Uh, what?  \e doesn't send anything to the server, it just edits
>> the query buffer locally.

> According to the manual:
> The new contents of the query buffer are then re-parsed according to
> the normal rules of psql, treating the whole buffer as a single line.
> Any complete queries are immediately executed (sic!); that is, if the
> query buffer contains or ends with a semicolon, everything up to that
> point is executed.

Ah.  So there are really two separate issues here:

1.  If there's complete query(s), they aren't echoed to the terminal
before execution.  Probably we could just echo them and be done
(though I wonder if this ought to depend on interactiveness).  I'm
not hugely excited about that, but it's reasonable.

2.  If there's a partial query, it's stuffed back into the query
buffer but you don't see it.  This is definitely bad, and IIRC it's
been complained of before, unlike point 1.  The problem is that
there's no portable way (AFAIK) of getting libreadline/libedit to
echo the partial query.  If you know of a way, please send a patch.

			regards, tom lane





view thread (8+ messages)  latest in thread

Message-ID: <10221.1570035107@sss.pgh.pa.us>
Permalink:  ../10221.1570035107@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10221.1570035107@sss.pgh.pa.us

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pavlo.golub@cybertec.at
  Subject: Re: BUG #16034: `\set ECHO all` doesn't work for \e command
  In-Reply-To: <10221.1570035107@sss.pgh.pa.us>
  References: <16034-a7ebf0622970a1dd@postgresql.org> <7946.1570031807@sss.pgh.pa.us> <CAK7ymcLvRGwjHXdvQX7eJVLS3SigmuvAxLWex+xz3ciEJqizqQ@mail.gmail.com> <10221.1570035107@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