Re: backslash in psql win32 - Mailing list pgsql-hackers-win32

From Martin Kanich
Subject Re: backslash in psql win32
Date
Msg-id cahgne$t7c$1@sea.gmane.org
Whole thread Raw
In response to backslash in psql win32  (<Tom.Zschockelt@flender.com>)
List pgsql-hackers-win32
Hi to all, specialy to Tom :-)

I have the same problem using backslash in mingw build of psql. the
reason for this "bug" is the use of readline
$POSTGRES_SOURCE\src\bin\psql\input.c

in function gets_interactive, if USE_READLINE defined the readline
function would be called:

#ifdef USE_READLINE
...
    if (useReadline)
       /* On some platforms, readline is declared as readline(char *) */
       s = readline((char *) prompt);
    else
       s = gets_basic(prompt);
...
#endif

if I set useReadline to false, it would use gets_basic and this works
with cmd & winxp & german settings (backslash using alt-gr). I don't
know what exactly happens in readline() and why it's better than
gets_basic(), but it shouldn't be used with msys/mingw.

Have a nice day,
Martin

Tom.Zschockelt@flender.com wrote:
>
> Hi to all,
>
>
> in win32 psql (startet from cmd.exe) it's not possible to execute any
> backslash command, because
> the backslash character does not appear . It's not possible to insert
> special characters !!!
>
> I changed the console charset to 850, 1252,
> but there is the same problem
>
> How can I solve this problem ?
>
> Regards
>
> tom
>
> hint : I use postgres-snapshot from 30.03.2004

pgsql-hackers-win32 by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pg_ctl start broken on windows
Next
From: Martin Kanich
Date:
Subject: Installer