Re: psql and Emacs on Windows

From: "Bill Bartlett" <bbartlett(at)softwareanalytics(dot)com>
To: <jd(at)commandprompt(dot)com>, "'Sam Mason'" <sam(at)samason(dot)me(dot)uk>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql and Emacs on Windows
Date: 2009-08-07 18:12:30
Message-ID: 054a01ca178a$a19c6f30$e4d54d90$@com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Friday, August 07, 2009 12:44 PM, Joshua D. Drake wrote:
> On Fri, 2009-08-07 at 17:36 +0100, Sam Mason wrote:
> > On Fri, Aug 07, 2009 at 11:11:10AM -0500, Wenjian Yang wrote:
> > > We currently installed emacs 23.1 and PostgreSQL 8.4.0 for Windows on a
> > > windows desktop. When issue "sql-postgres" in emacs, after providing
> > > User/Password/Database/Server, nothing happens. There is no prompt from
> > > emacs. Checking the server log, it doesn't seem to have received any
> > > connection request.
> >
> > The current setup on my windows box uses the psql that comes with
> > cygwin. Unfortunately I don't use it enough to remember the details of
> > how or why I settled on this setup.
>
> readline?
>

Yes, the problem is readline. When running the "native" psql.exe from inside
any sort of a "shell" program on Windows (such as from inside emacs, rxvt,
remote SSH command line, etc.), psql thinks it is running in batch mode so you
see no prompts. It is indeed running, but you'll see no interactive
information.

From my 8/4/2007 response to a similar posting:

(start)
We use the Cygwin version of the psql.exe program under Windows instead of the
native psql.exe program, even though the rest of the PostgreSQL installation
uses the standard native Windows versions of all the other PostgreSQL components
(database, tools, etc.). (So before I get flamed, I want to clarify that the
ONLY component of PostgreSQL that we use from Cygwin is psql.exe, and it's run
from an alternate directory.)

The main advantage that we get by using the Cygwin version of psql is that is
runs in "interactive" mode regardless of how it is run, whereas the native psql
program runs in non-interactive mode (showing almost no output, no prompts, no
readline support, etc.) when run from most "shell" programs. We frequently run
psql via a remote SSH connection or from the RXVT terminal program or from
inside Emacs, and in all of these cases the native psql program runs in
non-interactive mode whereas the Cygwin version of psql is fully-functional."
(end)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gauthier, Dave 2009-08-07 19:08:45 Getting linux $USER (and perhaps other env vars) in PL/pg-sql?
Previous Message Tom Lane 2009-08-07 17:33:59 Re: \copy: unexpected response (4)