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 1ioxLg-0008PD-Im for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jan 2020 22:29:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ioxLd-0002x4-L1 for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jan 2020 22:29:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ioxLd-0002wx-9G for pgsql-hackers@lists.postgresql.org; Tue, 07 Jan 2020 22:29:13 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ioxLZ-0004vn-R2 for pgsql-hackers@postgresql.org; Tue, 07 Jan 2020 22:29:11 +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 007MSvSB028774; Tue, 7 Jan 2020 17:28:57 -0500 From: Tom Lane To: Christoph Berg cc: Andres Freund , Amit Kapila , PostgreSQL Hackers Subject: Re: pgsql: Add basic TAP tests for psql's tab-completion logic. In-reply-to: <19973.1578351988@sss.pgh.pa.us> References: <20200103110128.GA28967@msg.df7cb.de> <13708.1578059577@sss.pgh.pa.us> <25771.1578249042@sss.pgh.pa.us> <20200106105608.GB18560@msg.df7cb.de> <3764.1578323719@sss.pgh.pa.us> <20200106191303.GA3975@msg.df7cb.de> <19973.1578351988@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 06 Jan 2020 18:06:28 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28772.1578436137.1@sss.pgh.pa.us> Date: Tue, 07 Jan 2020 17:28:57 -0500 Message-ID: <28773.1578436137@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > I installed libedit_3.1-20150325.orig.tar.gz from source here, and it > passes our current regression test and seems to behave just fine in > light manual testing. (I did not apply any of the Debian-specific > patches at [1], but they don't look like they'd explain much.) > So I'm a bit at a loss as to what's going wrong for you. Is the test > environment for Xenial the same as for the other branches? To dig deeper, I set up an actual installation of xenial, and on that I can replicate the tab-completion misbehavior you reported. The cause appears to be that libedit's rl_line_buffer does not contain the current line as expected, but the previous line (or, initially, an empty string). Thus, the hack I put in to make things pass on current libedit actually makes things worse on this version --- although it doesn't fully pass even if I revert ddd87d564, since there are other places where we depend on rl_line_buffer to be valid. So that raises the question: why does xenial's version of libedit not match either its documentation or the distributed source code? Because it doesn't. regards, tom lane