Re: Patch for psql History Display on MacOSX
| От | Tom Lane | 
|---|---|
| Тема | Re: Patch for psql History Display on MacOSX | 
| Дата | |
| Msg-id | 1201.1409842263@sss.pgh.pa.us обсуждение исходный текст | 
| Ответ на | Re: Patch for psql History Display on MacOSX (Noah Misch <noah@leadboat.com>) | 
| Ответы | Re: Patch for psql History Display on MacOSX | 
| Список | pgsql-hackers | 
Noah Misch <noah@leadboat.com> writes:
> I tried your patches against libedit-28.  Wherever a command contains a
> newline, unpatched psql writes the three bytes "\^A" to the history file, and
> patched psql writes the four bytes "\012".  Unpatched psql correctly reads
> either form of the history file.  Patched psql misinterprets a history file
> created by unpatched psql, placing 0x01 bytes in the recalled command where it
> should have newlines.  That's a worrisome compatibility break.
I think you got the test cases backwards, or maybe neglected the aspect
about how unpatched psql will only translate ^J to ^A in the oldest
(or maybe the newest? too pressed for time to recheck right now) history
entry.
The issue is that a patched psql, or a psql with a sufficient old libedit,
will apply ^J -> ^A to all entries when saving, and the reverse when
loading.  Without the patch, only the oldest entry gets transformed.
Failure to reverse the encoding in all lines is what creates a
user-visible problem.  If we do not fix this, that's what we risk.
We do not escape a problem by refusing to fix it.
        regards, tom lane
		
	В списке pgsql-hackers по дате отправления: