Re: [HACKERS] HISTIGNORE for psql

Поиск
Список
Период
Сортировка
От Vesa-Matti J Kari
Тема Re: [HACKERS] HISTIGNORE for psql
Дата
Msg-id alpine.LRH.2.20.1708182150100.2836@cedi.it.helsinki.fi
обсуждение исходный текст
Ответ на Re: [HACKERS] HISTIGNORE for psql  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: [HACKERS] HISTIGNORE for psql  (Vesa-Matti J Kari <vmkari@cc.helsinki.fi>)
Список pgsql-hackers
Hello,

On Thu, 17 Aug 2017, Pavel Stehule wrote:

> 2017-08-17 9:23 GMT+02:00 Vesa-Matti J Kari <vmkari@cc.helsinki.fi>:
>
>       Bash has HISTIGNORE feature that allows you to exclude certain commands
>       from the command history (e.g. shutdown, reboot, rm *).
>
>       Would it make any sense to add such a feature to psql (e.g. to ignore
>       DROP, DELETE commands)?
>
>
> It is not bad idea.

A quick patch is attached. Not sure about the quality, hacked this
together in about four hours, trying to figure out how to do it correctly
the PostgreSQL way.

Based on a few tests, the patch seems to work.

I do not know how the Bash implementation works, but I chose to disallow
forms such as:

:
:a
a:
a::b

So specifying empty strings seems like a syntax error to me. But I do
not know how to report failures for those, the current patch disallows
them and HISTIGNORE simply does not work with invalid syntax.

Regards,
vmk
-- 
************************************************************************
               Tietotekniikkakeskus / Helsingin yliopisto
                 IT department / University of Helsinki
************************************************************************
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] Update low-level backup documentation to match actual behavior
Следующее
От: Vesa-Matti J Kari
Дата:
Сообщение: Re: [HACKERS] HISTIGNORE for psql