Nigel Tamplin <nigel@metica.com> writes:
> Are there any libraries required by pgsql that maybe are present on some
> machines and not others hence the different behaviour?
Precisely. If the GNU readline library is not present when psql is
configured/built, you don't get history.
IIRC, some people have been burnt because they have installed
libreadline.a (or .so), but not readline.h. You need both, or
configure will decide to omit the feature.
regards, tom lane