Patch for psql History Display on MacOSX

Поиск
Список
Период
Сортировка
От Stepan Rutz
Тема Patch for psql History Display on MacOSX
Дата
Msg-id 7D95025B-E8D3-4FF7-AAC2-3B947F57DE64@gmx.de
обсуждение исходный текст
Ответы Re: Patch for psql History Display on MacOSX  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi everbody,

My first mail to this one, so please be mild. I fired up the debugger to get this item going, which is also on the Todo
List. 

Attached is a very trivial patch as a basis for discussion that at least makes \s (show history) work in psql on Macs.
Macsuses libedit, which has a libreadline interface.  

A short investigation showed that the way psql iterates over the history does not work with libedit. I changed the
iterationscheme to an index based loop (see code and comments), which seemed to be the only working option for both
readlineand libedit. In any case, i have tested and compiled this on MacOX 10.9.3 and Linux. Windows doesn’t have the
pagerin the first place.  

As noted in the todo I have made this code pay attention to the pager configuration from psql. The odd part is when
yourhistory opens in less you see the top part rather then the bottom part, but the bottom is just a single keystroke
away.If pager is disabled history is just printed fine. Please note that this didn’t work at all on Mac before. Could
thisgo into …./regress/sql/psql.sql at all? I am not sure on that one. 

Regards, Stepan






Вложения

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

Предыдущее
От: David G Johnston
Дата:
Сообщение: Re: PL/pgSQL 2
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PL/pgSQL 2