Re: Patch for psql History Display on MacOSX

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Patch for psql History Display on MacOSX
Дата
Msg-id 7834.1410113224@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Patch for psql History Display on MacOSX  (Noah Misch <noah@leadboat.com>)
Список pgsql-hackers
Noah Misch <noah@leadboat.com> writes:
> I ran libedit-history-fixes-v3.patch through my previous libedit-28 test.
> Now, patched psql writes ^A for newlines in any command.  Here's the new
> matrix of behaviors when recalling history:

>   master using master-written history:
>     oldest command: ok
>     rest: ok
>   v3-patched using master-written history:
>     oldest command: ok
>     rest: ok
>   master using v3-patched-written history
>     oldest command: ok
>     rest: each broken if it contained a newline
>   v3-patched using v3-patched-written history
>     oldest command: ok
>     rest: ok

> That's probably the same result you saw.  How does it compare to the
> compatibility effects for other libedit versions you tested?

Yeah, this is the behavior I'm expecting; libedit-13 and up all seem to
work like this.

It seems that in very old libedit versions (5.1, Tiger era) both the
existing loop and the patched version are able to iterate over more than
just the oldest command, though not necessarily the entire history ---
I've not figured out exactly what happens, and am not sure it's worth
bothering.  This means that in a ~/.psql_history made with such a version,
at least some commands besides the oldest might've had newlines converted
to ^A.  Such history files are currently broken when forward-ported to any
later libedit version; with the proposed patch, though, we would read them
correctly.  This gain makes me think the patch is worth the
backwards-compatibility loss you mention.
        regards, tom lane



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

Предыдущее
От: Marko Tiikkaja
Дата:
Сообщение: Re: pgcrypto: PGP signatures
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: Final Patch for GROUPING SETS - unrecognized node type: 347