Re: Windows v readline - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Windows v readline
Date
Msg-id d68ab455-ecbe-e90a-014f-c6a872575b8a@2ndquadrant.com
Whole thread Raw
In response to Windows v readline  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
Responses Re: Windows v readline
List pgsql-hackers
On 2019-09-29 22:55, Andrew Dunstan wrote:
> 
> The configure code currently has this:
> 
> 
> # readline on MinGW has problems with backslashes in psql and other bugs.
> # This is particularly a problem with non-US code pages.
> # Therefore disable its use until we understand the cause. 2004-07-20
> if test "$PORTNAME" = "win32"; then
>    if test "$with_readline" = yes; then
>      AC_MSG_WARN([*** Readline does not work on MinGW --- disabling])
>      with_readline=no
>    fi
> fi
> 
> 
> 2004 is a very long time ago. Has anyone looked at this more recently?
> It would certainly be nice to have readline-enabled psql on Windows if
> possible.

I tried this out.  First, it doesn't build, because readline doesn't do 
the dllimport/dllexport dance on global variables, so all references to 
rl_* global variables in tab-complete.c fail (similar to [0]).  After 
patching those out, it builds, but it doesn't work.  It doesn't print a 
prompt, keys don't do anything sensible.  I can enter SQL commands and 
get results back, but the readline part doesn't do anything sensible AFAICT.

Perhaps I did something wrong.  You can still use readline without 
global variables, but it seems like a serious restriction and makes me 
wonder whether this has actually ever been used before.  It's curious 
that MSYS2 ships a readline build for mingw.  Is there other software 
that uses it on Windows?


[0]: 
https://www.postgresql.org/message-id/001101c3eb6a$3b275500$f800a8c0@kuczek.pl

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: comment regarding double timestamps; and, infinite timestamps and NaN
Next
From: Dilip Kumar
Date:
Subject: Re: PATCH: logical_work_mem and logical streaming of largein-progress transactions