Thread: "history" key in pgsql

"history" key in pgsql

From
"Alex Cheung Tin Ka"
Date:
Hi all,
    I have some difficulties on typing the querys in the pgsql console environment. once I type something wrong I should delete the whole line and type in again.  I would like to know is there any tools that could make it more like the "bash" shell environment.  Using the arrow key there in the pgsql.
 
Thanks,
Alex

Re: "history" key in pgsql

From
Stephane Bortzmeyer
Date:
On Thu, Aug 08, 2002 at 04:15:33PM +0800,
 Alex Cheung Tin Ka <tkcheung@vtc.edu.hk> wrote
 a message of 43 lines which said:

> I have some difficulties on typing the querys in the pgsql console
> environment. once I type something wrong I should delete the whole
> line and type in again.  I would like to know is there any tools that
> could make it more like the "bash" shell environment.  Using the arrow
> key there in the pgsql.

pgsql has readline support (eaxctly the same library as bash). Your
PostgreSQL was probably compiled without this option. You compiled it
yourself? If so, compile again with --enable-readline (you will need
the readline library and its development environment).

(The Debian package of PostgreSQL has readline support
out-of-the-box. One more reason to thanks Oliver.)


Re: "history" key in pgsql

From
Oliver Elphick
Date:
On Thu, 2002-08-08 at 09:15, Alex Cheung Tin Ka wrote:
> Hi all,
>     I have some difficulties on typing the querys in the pgsql console
environment. once I type something wrong I should delete the whole line
and type in again.  I would like to know is there any tools that could
make it more like the "bash" shell environment.  Using the arrow key
there in the pgsql.
>

The feature you want is there already, provided that the readline
library is available when PostgreSQL is compiled.  Install the readline
development files and rebuild PostgreSQL.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK
http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Ye lust, and have not; ye kill, and desire to have,
      and cannot obtain; ye fight and war, yet ye have not,
      because ye ask not."            James 4:2