Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 68EC3633C7B for ; Mon, 29 Jun 2009 04:26:45 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 05052-03 for ; Mon, 29 Jun 2009 04:26:44 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from trabant.cianoz.org (host31-194-149-62.serverdedicati.aruba.it [62.149.194.31]) by mail.postgresql.org (Postfix) with ESMTP id 46D45633A35 for ; Mon, 29 Jun 2009 04:26:43 -0300 (ADT) Received: from [192.168.100.8] (mfalcon.irpi.cnr.it [194.119.218.2]) by trabant.cianoz.org (Postfix) with ESMTP id 7D9C750CE5; Mon, 29 Jun 2009 09:26:41 +0200 (CEST) Subject: Re: .psql_history": No such file From: ivan marchesini Reply-To: marchesini@unipg.it To: Shane Ambler Cc: Guillaume Lelarge , pgsql-sql@postgresql.org In-Reply-To: <4A463C15.8010309@Sheeky.Biz> References: <1246031595.4836.27.camel@ivangeo> <200906261814.59148.guillaume@lelarge.info> <4A463C15.8010309@Sheeky.Biz> Content-Type: text/plain; charset="UTF-8" Organization: University of Perugia Date: Mon, 29 Jun 2009 09:47:25 +0200 Message-Id: <1246261645.4803.46.camel@ivangeo> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1.1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.1 tagged_above=0 required=5 tests=RDNS_DYNAMIC=0.1 X-Spam-Level: X-Archive-Number: 200906/115 X-Sequence-Number: 32720 Thanks to all... in effect it is a very little problem if you consider that probably I will call psql from normal accounts... :-) thanks Il giorno dom, 28/06/2009 alle 01.04 +0930, Shane Ambler ha scritto: > Guillaume Lelarge wrote: > > Hi Ivan, > > > > Le vendredi 26 juin 2009 à 17:53:15, ivan marchesini a écrit : > >> [...] > >> I have installed a postgres db using a datadir different > >> from /var/lib/pgsql/.psql_history. > >> > >> then: > >> su postgres > >> psql postgres > >> > >> All went fine but when I exit from psql from a db I obtain: > >> _______ > >> could not save history to file "/var/lib/pgsql/.psql_history": No such > >> file or directory > >> _______ > >> > >> how can I fix this problem? where can I say psql that it must > >> write .psql_history into the datadir? > >> > > > > psql tries to write there because the home directory of the postgres user is > > /var/lib/postgres. Probably better to use HISTFILE to change it (\set HISTFILE > > '/path/to/histfile'). > > > > Regards. > > > > > You do know that you don't need to su postgres to start psql? > > Only the server needs to be run with the postgres user account. If you > run psql from your normal user account the history file will be saved > into your home folder not the postgresql install/data file dir. > > > -- > > Shane Ambler > pgSQL (at) Sheeky (dot) Biz > >