call win32 psql from cygwin

Andy Koppe andy.koppe@gmail.com
Sun Oct 11 19:02:00 GMT 2009


2009/10/11 Sivaram Neelakantan:
> I installed the win32 binary of PostgreSQL 8.4 in C:/PostgreSQL.
> Launching mintty in cygwin and calling psql, the only thing that seems
> to work is the psql --help call.
>
> $/cygdrive/c/PostgreSQL/8.4/bin/psql  -d mf -U sivaram
>
> simply waits till I hit Ctrl-C.

Win32 console programs often check whether their stdin/out is a
console device in order to decide whether to enter interactive mode.
Mintty, however, is based on Cygwin's pseudo terminal (pty) devices,
which are implemented using Windows pipes. Hence Win32 psql probably
enters non-interactive mode when run in mintty (or other pty-based
terminals).

Lots more discussion about this here:
http://code.google.com/p/mintty/issues/detail?id=56

Three possible solutions:
1. Use the Cygwin version of Postgres, which can be installed through setup.exe
2. Check whether psql has an option to explicitly put it into interactive mode
3. Run it in the default Cygwin console


> Is it possible at all to use the win32 databases from shell scripts
> written in cygwin bash?

The issue above shouldn't affect scripts.

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list