Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YWeuO-0003Q6-2g for pgsql-bugs@arkaria.postgresql.org; Sat, 14 Mar 2015 05:46:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YWeuM-0006KI-Ni for pgsql-bugs@arkaria.postgresql.org; Sat, 14 Mar 2015 05:46:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YWeuK-0006K9-PH for pgsql-bugs@postgresql.org; Sat, 14 Mar 2015 05:46:44 +0000 Received: from mail.catalyst.net.nz ([2404:130:0:10::40:0]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YWeu8-00052e-K4 for pgsql-bugs@postgresql.org; Sat, 14 Mar 2015 05:46:42 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.catalyst.net.nz (Postfix) with ESMTP id 97058324BF; Sat, 14 Mar 2015 18:46:20 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at catalyst.net.nz Received: from mail.catalyst.net.nz ([127.0.0.1]) by localhost (bertrand.catalyst.net.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cnxOnKxN1k2j; Sat, 14 Mar 2015 18:46:18 +1300 (NZDT) Received: from [192.168.1.64] (122-60-254-240.jetstream.xtra.co.nz [122.60.254.240]) (Authenticated sender: mark.kirkwood) by mail.catalyst.net.nz (Postfix) with ESMTPSA id 409F3320A3; Sat, 14 Mar 2015 18:46:18 +1300 (NZDT) Message-ID: <5503CB2A.5020003@catalyst.net.nz> Date: Sat, 14 Mar 2015 18:46:18 +1300 From: Mark Kirkwood User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Alvaro Herrera , Tom Lane CC: Jeff Frost , "David G. Johnston" , "pgsql-bugs@postgresql.org" Subject: Re: bogus psql "could not save history file[...]" message in 9.3.6 References: <31313.1426298202@sss.pgh.pa.us> <31999.1426299748@sss.pgh.pa.us> <20150314024619.GJ3291@alvh.no-ip.org> In-Reply-To: <20150314024619.GJ3291@alvh.no-ip.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) 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 On 14/03/15 15:46, Alvaro Herrera wrote: > Tom Lane wrote: >> Jeff Frost writes: >>>> On Mar 13, 2015, at 9:56 PM, Tom Lane wrote: >>>> strace'ing psql while it exits might be informative. >> >>> Here you go: >> >>> ... >>> rename("/var/lib/postgresql/.psql_history", "/var/lib/postgresql/.psql_history-") = -1 ENOENT (No such file or directory) >>> open("/var/lib/postgresql/.psql_history", O_WRONLY|O_CREAT|O_TRUNC, 0600) = 3 >>> write(3, "select 1;\n", 10) = 10 >>> close(3) = 0 >>> unlink("/var/lib/postgresql/.psql_history-") = -1 ENOENT (No such file or directory) >> >> ... WTF? That rename() and that unlink() are certainly not coming from >> Postgres, and I do not see anything like that in the libedit sources >> either. (I'm looking at the libedit-20141030-3.1 version that Fedora >> is currently shipping.) That must be coming from some Ubuntu-specific >> patch? > > You can use > apt-get source libedit2 > to obtain a copy of the tarball plus all the patches that were applied > to build the package. > Also might be worth checking the ownership of postgres home directory (/var/lib/postgresql) - I'd hazard a guess that it is owned by root and postgres cannot write the history file. Cheers Mark -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs