Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gj4fF-0004Nq-Ep for pgsql-bugs@arkaria.postgresql.org; Mon, 14 Jan 2019 16:00:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gj4eF-0002TT-R2 for pgsql-bugs@arkaria.postgresql.org; Mon, 14 Jan 2019 15:59:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gj4eF-0002TM-KS for pgsql-bugs@lists.postgresql.org; Mon, 14 Jan 2019 15:59:35 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gj4eC-0001ci-L3 for pgsql-bugs@postgresql.org; Mon, 14 Jan 2019 15:59:34 +0000 Received: by mail-wr1-x442.google.com with SMTP id x10so23440345wrs.8 for ; Mon, 14 Jan 2019 07:59:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=At4JNY7AAFvF+V9c0kTbbtfHSlsuAHmFKcgo8j9vQz8=; b=py0Ln41HWN8DnVwXTfW9haaUzX1Dt8iDR9kl7BWiDuFpuasjs1gZLgqJa0KvNlRtk5 UYxkwna+mb3Ka8loiqY1N54mbvklm90Pr7M/fXaoaesyXMu1/ciLmDWOjmZnnDm02ouA RQPebKn/xQ2ZQVxSfE4CC/l9ezXXoGZJ33jeUUdTJ7MkIAUl2t/r0Cx3iTBKu5uwP+uw PpdbrJ0rBBks9eY7OrpOJoYEajIAIpg4469X3ycqXP/t38ueBlwFO2uNtFpgmpCY60Pe VmXpdE5QEvxgBZ6mwZqAXJ3hufFssq3mmyEI8wGxOiJDyilb6oSY0XgoWELcVecjpey+ KzVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=At4JNY7AAFvF+V9c0kTbbtfHSlsuAHmFKcgo8j9vQz8=; b=lN1vxAtT6yLofS4miVx6Ixuc8vLfugCheFhWGHBXsAwQoRzwNic69UUw4/HxloYtrJ B4VwckPDnkiS0qjj09DkFBAYu5q0Bk1G7BBmsLC7rnvbLA9fGmu8TnEZqEkn/pJaSP7X 2PtHERGDfaMU2emPl4Xw5hSObcLcKcu9TAachQZxTrGGs6Awn5F3jzxlaVn8uvpjEm7T wiAvH9eKCWSXpAKHaH+HfL3q51ccXJ63aKgrYn1qfKuaGc6L+33tlVvZI4s4+1i1tNZ4 rLmRsLcHWyTj3pvJ1CchdDVSDq3ECFafQ5QQE9g2iMDJZ7sgvHaU9+aui/Jd24p8gWAD X2Dg== X-Gm-Message-State: AJcUukcqftgO0+jTNqE1GVtrKzDu1hOPvcAP+kgkyW82XOmiVMZwF9G5 y3YF8wpHJHLCb/vS4ZTkJdzKwA== X-Google-Smtp-Source: ALg8bN6ihw+G+BISjkrjQxmV/GucrUUJD+1SOR+cal8ujLtvxm3ShIGMTwAuS9eBJI+uY1bxDZlPag== X-Received: by 2002:adf:8c09:: with SMTP id z9mr25048845wra.301.1547481571156; Mon, 14 Jan 2019 07:59:31 -0800 (PST) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id b18sm70217513wrw.83.2019.01.14.07.59.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Jan 2019 07:59:30 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id C5210C2A; Mon, 14 Jan 2019 12:59:26 -0300 (-03) Date: Mon, 14 Jan 2019 12:59:26 -0300 From: Alvaro Herrera To: =?utf-8?B?0JTQuNC70Y/QvSDQn9Cw0LvQsNGD0LfQvtCy?= Cc: Tom Lane , pgsql-bugs@postgresql.org, Peter Eisentraut Subject: Re: psql and readline comments Message-ID: <201901141559.ne4yhv2nwsl5@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7493dbdd54775b1160d7971039c575cab2b0e331.camel@aegee.org> User-Agent: NeoMutt/20180716-1013-2c1e88 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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