Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYFDf-0000gZ-Aa for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Aug 2016 16:22:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bYFDe-0006VH-Ta for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Aug 2016 16:22:02 +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 1bYFD1-0005nz-8K for pgsql-bugs@postgresql.org; Fri, 12 Aug 2016 16:21:23 +0000 Received: from [2001:41d0:2:9c82::1] (helo=ks311736.kimsufi.com) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYFCx-0005E4-WE for pgsql-bugs@postgresql.org; Fri, 12 Aug 2016 16:21:22 +0000 Received: from genius-map.net (verite.pro [195.154.189.246]) by ks311736.kimsufi.com (Postfix) with ESMTP id 25954C0A9B; Fri, 12 Aug 2016 18:45:48 +0200 (CEST) Received: by genius-map.net (Postfix, from userid 1001) id 7E36C38A1C6F; Fri, 12 Aug 2016 18:21:17 +0200 (CEST) Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: BUG #14287: psql_history gets wiped out From: "Daniel Verite" To: "Rick Otten" Cc: pgsql-bugs@postgresql.org In-Reply-To: Date: Fri, 12 Aug 2016 18:21:13 +0200 Message-Id: X-Mailer: Manitou v1.5.1 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2001:41d0:2:9c82::1 (failed) X-Pg-Spam-Score: -1.1 (-) 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 Rick Otten wrote: > think I have readline installed on the system:=20 >=20 > $ dpkg -l | grep readline > ii libreadline5:amd64 5.2+dfsg-2 amd64 GNU readline and history > libraries, run-time libraries > ii libreadline6:amd64 6.3-4ubuntu2 amd64 GNU readline and history > libraries, run-time libraries > ii readline-common=20 According to the strace output, the replacement of libedit by libreadline at runtime does not happen in your case (the "_HiStOrY_V2_" string is from libedit). This replacement is done by pg_wrapper, a Perl script to which /usr/bin/psql is normally linked: $ ls -l /usr/bin/psql /usr/bin/psql -> ../share/postgresql-common/pg_wrapper The script pushes libreadline over libedit through LD_PRELOAD, and launches the actual binary located in=20 /usr/lib/postgresql/X.Y/bin/psql (where X.Y is the current cluster's PG version). You may want to check if that script is not entirely sidestepped in your setup, as that would explain why libedit gets used. For instance, a modified PATH or psql being a shell alias could lead to that. Aside from the bug resulting in an empty file, libedit will ignore readline's history and remove it from the file when saving, which is annoying by itself if using it by accident. Best regards, --=20 Daniel V=E9rit=E9 PostgreSQL-powered mailer: http://www.manitou-mail.org Twitter: @DanielVerite --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs