pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: pkorobeinikov@gmail.com
Subject: BUG #15002: Unexpected behaviour in psql \r command
Date: Tue, 09 Jan 2018 17:45:10 +0000
Message-ID: <20180109174510.21778.96128@wrigleys.postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15002
Logged by:          Petr Korobeinikov
Email address:      pkorobeinikov@gmail.com
PostgreSQL version: 10.0
Operating system:   Any (reproduced in macOS Sierra, Slackware)
Description:        

Dear hackers!

Unexpected behaviour of \r subcommand has been introduced in 10.0
(e984ef5861df4bc9733b36271d05763e82de7c04).

Previously (at least in 9.6) previous_buf hasn’t been used for any kinds of
\e subcommand.
Now if query_buf is empty previous buffer contents is used.

It makes useless \r subcommand in cases when clean buffer required in next
\e.
Multiple calls of \r takes no effect.

Code snippet:
```
794 +
795 +               /* Applies to previous query if current buffer is empty
*/
796 +               copy_previous_query(query_buf, previous_buf);
797 +
798                 if (do_edit(fname, query_buf, lineno, NULL))
799                     status = PSQL_CMD_NEWEDIT;
```



view thread (3+ messages)  latest in thread

Message-ID: <20180109174510.21778.96128@wrigleys.postgresql.org>
Permalink:  ../20180109174510.21778.96128@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20180109174510.21778.96128@wrigleys.postgresql.org

 · 

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: noreply@postgresql.org, pkorobeinikov@gmail.com
  Subject: Re: BUG #15002: Unexpected behaviour in psql \r command
  In-Reply-To: <20180109174510.21778.96128@wrigleys.postgresql.org>
  References: <20180109174510.21778.96128@wrigleys.postgresql.org>

* 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