X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 	tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <82vdilg7vt.fsf@gmail.com>
References: <82vdilg7vt.fsf@gmail.com>
Date: Sun, 11 Oct 2009 20:02:31 +0100
Message-ID: <416096c60910111202o2a87dab5qae56ec3e385d3f61@mail.gmail.com>
Subject: Re: call win32 psql from cygwin
From: Andy Koppe <andy.koppe@gmail.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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 =C2=A0-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=3D56

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 m=
ode
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

