psql and readline comments

From: Дилян Палаузов <dpa-postgres(at)aegee(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: psql and readline comments
Date: 2019-01-13 10:47:50
Message-ID: b10ba6a38a7f02207ccd0a848c620d7176149e46.camel@aegee.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello,

please consider integrating making the usual readilne binding M-# do in psql what users expect from it: insert comment
at the beginning of the line. See for patch:

https://www.postgresql.org/message-id/01e0355e-381e-9732-7d4e-cbd0e6bfa710@aegee.org

At
https://www.postgresql.org/message-id/0afcbc3f-8c1c-c576-824a-5cc02e5a81e5@2ndquadrant.com was suggested to postpone
this for PG11. Now you can integrate this on the master branch.

diff --git a/src/bin/psql/input.c b/src/bin/psql/input.c
--- a/src/bin/psql/input.c
+++ b/src/bin/psql/input.c
@@ -356,6 +356,8 @@ initializeInput(int flags)
/* these two things must be done in this order: */
initialize_readline();
rl_initialize();
+ if (!strcmp("#", rl_variable_value("comment-begin")))
+ rl_variable_bind("comment-begin", "--");

useHistory = true;
using_history();

Regards
Дилян

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-01-13 15:08:18 Re: psql and readline comments
Previous Message leif 2019-01-12 07:40:07 Re: BUG #15589: Due to missing wal, restore ends prematurely and opens database for read/write