The problem is that your psql wasn't compiled with readline support, which
is the library that allows you to use the arrow up/down command line
history. There is a known problem (discussed last week on this list) where
the configure script for Postgres won't detect the readline library under
certain conditions (I think it was that the readline.h had to be in
/usr/include/ as well as /usr/include/readline/)
The first thing you will want to do is make sure you have the readline
library (running "find /usr/include -name readline.h -print" should show
you if you do) and if not, go install it. If you do, try this while logged
in as root (I haven't tested it, so it's just a guess):
cd /usr/include
echo "#include <readline/readline.h>" >readline.h
cd /usr/src/pgsql/src (or wherever your Postgres source is installed)
make distclean
./configure
make
cd bin/psql
make installl
If you installed from a precompiled package (ie, an RPM) then I'm not sure
what your options are. Probably go look for a new RPM. :)
BTW: Is this in the FAQ? It gets asked a lot.
At 06:43 AM 5/12/00, Differentiated Software Solutions Pvt. Ltd. wrote:
>Hi,
>
>In shell script arrow keys retrieve the previous command, but within psql
>these arrow keys are not working ?? Can anybody tell me how to set this up.
>
>Murali
>
>Differentiated Software Solutions Pvt. Ltd.,
>176, Gr. Floor, 6th Main
>2nd Block RT Nagar
>Bangalore - 560 032
>India
>Ph: 91 80 3431470
>email : diffs+AEA-vsnl.com
>http://www.diffs-india.com