pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Дилян Палаузов <dpa-postgres@aegee.org>
Cc: pgsql-bugs@postgresql.org
Subject: Re: psql history and "-- lines"
Date: Sat, 06 May 2017 19:17:42 -0400
Message-ID: <7127.1494112662@sss.pgh.pa.us> (raw)
In-Reply-To: <af1bad5f-56c6-485d-22ba-5bb282d8c137@aegee.org>
References: <48b3a5ac-d219-6568-6751-260b1387bc37@aegee.org>
	<CAKFQuwZ8f9smjWr97qFW+scCg+bydiKHHpEO6gs6Pq=DQxWoaA@mail.gmail.com>
	<19006.1494033923@sss.pgh.pa.us>
	<af1bad5f-56c6-485d-22ba-5bb282d8c137@aegee.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

=?UTF-8?B?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?= <dpa-postgres@aegee.org> writes:
> I expect that psql and the shell, e.g. bash, behave in the same way in 
> regards to history logs and until-the-current-line comments.

I do not think that the shell necessarily provides a gold-plated precedent
for us to follow.  The language syntax it's dealing with is substantially
different from SQL.  Even ignoring that point, there are a lot of shell
implementations with a lot of different interactive behaviors; who's to
say that bash is the one true way?

> +               rl_variable_bind("comment-begin", "--");

Interesting thought, but IIUC that's a setting that would be better left
to the user's ~/.inputrc, or might indeed override something he's put
there.  I'm also dubious how well it works across all the versions of
readline and libedit that are out there.

Perhaps we could document suggested settings for people to put into
~/.inputrc:

	$if psql
	set comment-begin "-- "
	... other things?
	$endif


			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (8+ messages)  latest in thread

Message-ID: <7127.1494112662@sss.pgh.pa.us>
Permalink:  ../7127.1494112662@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7127.1494112662@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, dpa-postgres@aegee.org
  Subject: Re: psql history and "-- lines"
  In-Reply-To: <7127.1494112662@sss.pgh.pa.us>
  References: <48b3a5ac-d219-6568-6751-260b1387bc37@aegee.org> <CAKFQuwZ8f9smjWr97qFW+scCg+bydiKHHpEO6gs6Pq=DQxWoaA@mail.gmail.com> <19006.1494033923@sss.pgh.pa.us> <af1bad5f-56c6-485d-22ba-5bb282d8c137@aegee.org> <7127.1494112662@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