pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Дилян Палаузов <dpa-postgres@aegee.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Subject: Re: psql and readline comments
Date: Mon, 14 Jan 2019 12:59:26 -0300
Message-ID: <201901141559.ne4yhv2nwsl5@alvherre.pgsql> (raw)
In-Reply-To: <7493dbdd54775b1160d7971039c575cab2b0e331.camel@aegee.org>

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




view thread (13+ messages)  latest in thread

Message-ID: <201901141559.ne4yhv2nwsl5@alvherre.pgsql>
Permalink:  ../201901141559.ne4yhv2nwsl5@alvherre.pgsql/
Also on:    postgresql.org/message-id/201901141559.ne4yhv2nwsl5@alvherre.pgsql

 · 

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: alvherre@2ndquadrant.com, dpa-postgres@aegee.org, tgl@sss.pgh.pa.us, peter.eisentraut@2ndquadrant.com
  Subject: Re: psql and readline comments
  In-Reply-To: <201901141559.ne4yhv2nwsl5@alvherre.pgsql>
  References: <7493dbdd54775b1160d7971039c575cab2b0e331.camel@aegee.org> <201901141559.ne4yhv2nwsl5@alvherre.pgsql>

* 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