Re: psql: customizable readline history filename - Mailing list pgsql-patches

From Andreas Seltenreich
Subject Re: psql: customizable readline history filename
Date
Msg-id 87slzqkwue.fsf@gate450.dyndns.org
Whole thread Raw
In response to Re: psql: customizable readline history filename  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: psql: customizable readline history filename
List pgsql-patches
Bruce Momjian schrob:

> I noticed your documentation example had a space before :DBNAME --- I
> removed the space.

This space is necessary for proper expansion of the parameter. The
\set-Command concatenates all its arguments after expansion:

--8<---------------cut here---------------start------------->8---
scratch=# \set HISTFILE .psql_history-:DBNAME
scratch=# \echo :HISTFILE
.psql_history-:DBNAME
scratch=# \set HISTFILE .psql_history- :DBNAME
scratch=# \echo :HISTFILE
.psql_history-scratch
scratch=#
--8<---------------cut here---------------end--------------->8---

> You had the idea of not saving the history on exit if HISTFILE is not
> set.  I don't think we have community agreement on that change, and I
> bet we wouldn't get it.  (I have removed your documentation mention of
> this.)  I think setting HISTSIZE to zero has that effect already if
> people want it.

I went for bash's behaviour back then, since we copied bash's
semantics with the other history options too.

Thanks!
Andreas

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Grammer Cleanup
Next
From: Neil Conway
Date:
Subject: Re: final light versions of Oracle compatibility (SQLSTATE,