Re: Correct handling of blank/commented lines in PSQL interactive-mode history

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>, "David G. Johnston" <david.g.johnston@gmail.com>, Greg Nancarrow <gregn4422@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2021-09-07T19:16:25Z
Lists: pgsql-hackers

Attachments

[ this is a digression from the main point of the thread, but ... ]

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> I am particularly bothered by the uselessness
> that M-# results in -- namely, inserting a # at the start of the buffer.

Fixing that might be as simple as the attached.  I've not beat on
it hard though.

			regards, tom lane

Commits

  1. psql: initialize comment-begin setting to a useful value by default.

  2. psql: treat "--" comments between queries as separate history entries.

  3. psql: include intra-query "--" comments in what's sent to the server.