Re: Patch for psql History Display on MacOSX

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Stepan Rutz <stepan(dot)rutz(at)gmx(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Patch for psql History Display on MacOSX
Date: 2014-09-07 18:07:04
Message-ID: 7834.1410113224@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Noah Misch <noah(at)leadboat(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2014-09-07 18:27:07 Re: Final Patch for GROUPING SETS - unrecognized node type: 347
Previous Message Marko Tiikkaja 2014-09-07 17:36:27 Re: pgcrypto: PGP signatures