Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d790L-0002Y4-Ld for pgsql-bugs@arkaria.postgresql.org; Sat, 06 May 2017 23:20:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d790K-0006jT-IE for pgsql-bugs@arkaria.postgresql.org; Sat, 06 May 2017 23:20:48 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d78zb-0005QB-Ma for pgsql-bugs@postgresql.org; Sat, 06 May 2017 23:20:03 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d78zY-0005l0-Ma for pgsql-bugs@postgresql.org; Sat, 06 May 2017 23:20:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v46NHgi8007128; Sat, 6 May 2017 19:17:42 -0400 From: Tom Lane To: =?UTF-8?B?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?= cc: pgsql-bugs@postgresql.org Subject: Re: psql history and "-- lines" In-reply-to: References: <48b3a5ac-d219-6568-6751-260b1387bc37@aegee.org> <19006.1494033923@sss.pgh.pa.us> Comments: In-reply-to =?UTF-8?B?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?= message dated "Sat, 06 May 2017 21:45:08 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7126.1494112662.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 06 May 2017 19:17:42 -0400 Message-ID: <7127.1494112662@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org =3D?UTF-8?B?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?=3D writes: > I expect that psql and the shell, e.g. bash, behave in the same way in=20 > 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 --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs