Re: psql: backslash fix

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>
Cc: <pgsql-patches(at)postgresql(dot)org>
Subject: Re: psql: backslash fix
Date: 2002-03-12 00:17:51
Message-ID: Pine.LNX.4.30.0203111916070.690-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Neil Conway writes:

> > 3. Ignore the failed backslash command and keep going. This is what it's
> > doing.
>
> Even if we want to continue with this behavior, I think the current
> implementation is confusing: psql should recall the previous buffer, set
> the prompt to "=>", and allow the user to continue editing the command.
> For example:
>
> nconway=> select foo\\bar;
> Invalid command \. Try \? for help.
> nconway=> select foo
> ^^^^^^^^^^ recalled by psql, the user can continue
> typing after this point

That's an interesting idea. I'm sure readline can do this, but I haven't
looked.

> > Think of psql as an editor and (some of) the backslash commands as editor
> > commands. When you enter a wrong command in your editor, what does it do?
>
> It gives me an error. For instance, in vim:
>
> ":set nooooexpandtab" -> "Unknown option: nooooexpandtab"
>
> And it returns me to my previous mode. It does _not_ recall ":set ..."

Yes, but note that it doesn't completely clear the editing area or save
the file or compile it.

--
Peter Eisentraut peter_e(at)gmx(dot)net

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2002-03-12 00:22:01 Re: support for POSIX 1003.1-2001 hosts
Previous Message Peter Eisentraut 2002-03-12 00:14:46 Re: Domain Support -- another round