Re: psql and readline comments

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Дилян Палаузов <dpa-postgres(at)aegee(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)postgresql(dot)org, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Subject: Re: psql and readline comments
Date: 2019-01-14 15:59:26
Message-ID: 201901141559.ne4yhv2nwsl5@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2019-Jan-13, Дилян Палаузов wrote:

> Hello,

Hello, please don't top-post.

> On Sun, 2019-01-13 at 10:08 -0500, Tom Lane wrote:
>
> > I remain of the opinion that (1) nobody has tested the proposed patch
> > across a range of readline and libedit versions, and (2) this would
> > probably be better addressed by a documentation addition anyway.
> > It's not psql's job to override user-settable readline options.
>
> when the user does not set anything, the presumption is, that the
> system has reasonable defaults. A reasonable default for
> “comment-begin” is “--”, and not the inherited default “#”.

I agree -- it doesn't make sense to treat the insert-comment command as
inserting a #, which is not a comment for psql. I use meta-# often in
bash and I'm never happy to have to resort to manually prepending "--"
in psql in order to make the current line a comment instead. The other
suggested changes in the original thread are of course much more
complicated and would require more research, but this one seems like a
slam-dunk improvement.

Now you may wish (as I once did) for the whole of the current input
buffer to become a comment instead, but it doesn't work that way in bash
either (only the current line; but then bash doesn't have multiline
comments AFAIK) and I don't think psql needs to do terribly much more
than that.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-01-14 16:24:40 Re: BUG #15592: Memory overuse with subquery containing unnest() and set operations (11.x regression)
Previous Message PG Bug reporting form 2019-01-14 14:55:20 BUG #15592: Memory overuse with subquery containing unnest() and set operations (11.x regression)