Re: Multiple psql history files

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Multiple psql history files
Дата
Msg-id 21131.1476809120@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Multiple psql history files  (Jonathan Jacobson <jonjac@gmail.com>)
Ответы Re: Multiple psql history files  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-hackers
Jonathan Jacobson <jonjac@gmail.com> writes:
> The .psql_history file is naturally used by different DB connections
> (distinguished by a different combination of host + port + database + user).
> At least in my multi-database working environment, this leads sometimes to
> frustration because there are commands that cannot or should not be used by
> different connections.
> To solve this, psql could keep a separate command history file for each
> connection.
> I will be happy to make this my first contribution to PostgreSQL's code.
> What do you say?

Personally, I'd be strongly against that because I frequently *want*
to re-use the same command on different connections.  As an example,
comparing the behavior of the same command in different PG versions
(hence different postmasters) is an everyday task for me.

I can see that others might have different needs, but surely this
is going to be a use-case-specific requirement.

It's already possible to control which history file is used via psql's
HISTFILE variable and/or the PSQL_HISTORY environment variable.  Perhaps
you can solve your problem today by manipulating those?

One interesting point, if you wish to consider history as being
connection-specific, is what happens during a \c command.  Right
now the answer is "nothing" but you might wish it were different.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Multiple psql history files
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Multiple psql history files