The psql client supports some of the same command-tracking features that the bash shell supports; namely, the reverse-i-search, tab completion, and command history (stored in /home/[username]/.psql_history). These features are all available because psql supports both the readline and history libraries, which provide those functions to bash .
If the configure script finds the readline library, this option should be automatically installed when you compile PostgreSQL. If psql does not support tab-completion, history, or reverse-i-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, locate them (the file names are: libreadline.a , readline.h , and history.h .
If you wish to reconfigure psql to use these features, the first thing to do is find the listed files. Once you know where they 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.