BUG #5616: psql Doesn't Change Log files on \c - Mailing list pgsql-bugs

From David E. Wheeler
Subject BUG #5616: psql Doesn't Change Log files on \c
Date
Msg-id 201008122205.o7CM5Y2J050600@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #5616: psql Doesn't Change Log files on \c  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      5616
Logged by:          David E. Wheeler
Email address:      david@kineticode.com
PostgreSQL version: 8.4
Operating system:   Mac OS X 10.6.4
Description:        psql Doesn't Change Log files on \c
Details:

I have this in my .psqlrc:

    \set HISTFILE ~/.psql_history- :DBNAME

This is great, except when I change databases in a session:

    % psql foo
    foo % \c bar
    You are now connected to database "bar".
    SELECT true;

The last statement will be logged to ~/.psql_history-foo when it should go
to ~/.psql_history-bar.

pgsql-bugs by date:

Previous
From: Robert Haas
Date:
Subject: Re: BUG #5613: cannot delete
Next
From: Tom Lane
Date:
Subject: Re: BUG #5616: psql Doesn't Change Log files on \c