The
psql
client supports some of the same command-tracking features that the bash shell
supports; namely, reverse-i-search, tab completion, and command history (command history is stored in
/home/
[username]
/.psql_ history
). These features are all available because
psql
support the readline library, which provide these functions to bash.
If the configure script finds the readline library, reverse-i-search, tab completion and command history should be automatically
installed when you compile PostgreSQL. If
psql
does not support tab-completion, history, or
reverse-i-search (history search), it may be because you either have the library files and/or header files installed
into a non-standard directory. If this is the case, and you wish to reconfigure
psql
to use the readline and history
features, your first task is to locate the library header files. (The filenames are:
libreadline.a
,
readline.h
, and
history.h
).
Once you know where the library and header files are stored on your filesystem, tell the PostgreSQL
configure
script where they are by using the following flags:
--with-includes=
[.h file locations]
, and
--with-libs=[
lib file location
]
.
After reconfiguration, remake the
psql
binary, and the features should become available.
See the Section called Step 3: Configuring the Source Tree in Chapter 2" in Chapter 2 for more on the configuration
process of PostgreSQL.