Noah Misch <n...@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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to