psql: can't get readline support

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

psql: can't get readline support

Denis Gantsev
Hello psql-novice
I am trying to compile postgres with readline support, but no luck, even if I am pretty sure I have readline available...
denis ~/CProjects/postgres (REL_12_STABLE) $ pkg-config --libs readline
-L/usr/local/lib -lreadline

denis ~/CProjects/postgres (REL_12_STABLE) $ pwd
/home/denis/CProjects/postgres

./
configure --with-readline=yes
...
checking readline/readline.h usability... yes
...
make
sudo make install

But then when using it:
denis ~/CProjects/postgres (REL_12_STABLE) $ which psql
/home/denis/CProjects/postgres/bin/psql
denis ~/CProjects/postgres (REL_12_STABLE) $ psql -d postgres
psql (12.0)
Type "help" for help.

postgres
=# \s history is not supported by this installation
System: Linux 4.15
Readline version: 8.0
gcc (GCC) 9.2.0

Could someone kindly help?
Regards
Denis
Reply | Threaded
Open this post in threaded view
|

Re: psql: can't get readline support

Tom Lane-2
Denis Gantsev <[hidden email]> writes:
> Hello psql-novice
> I am trying to compile postgres with readline support, but no luck, even if
> I am pretty sure I have readline available...

You need to look further down than this:

> checking readline/readline.h usability... yes

specifically for a line like

checking for library containing readline... -lreadline

which I imagine is reporting "no" for you.

The most usual cause of this sort of problem is forgetting to install the
devel support package for readline (on most Linuxen you need something
like readline-devel or readline-dev, not just the base readline package).

However, the devel package is usually what provides the .h files too,
so I'm a bit mystified as to what's wrong.  Possibly, it'd be informative
to look into config.log to see what the underlying error report is for the
"library containing readline" test.

Also ...

denis ~/CProjects/postgres (REL_12_STABLE) $ pkg-config --libs
readline-L/usr/local/lib -lreadline

... you may need to say explicitly "--with-libraries=/usr/local/lib"
to get configure to look there for the library.  The default linker
configuration on Linuxen is not that friendly to putting libraries
outside the system library directory.

                        regards, tom lane


Reply | Threaded
Open this post in threaded view
|

Re: psql: can't get readline support

Denis Gantsev

On Wed, 25 Mar 2020 at 23:12, Tom Lane <[hidden email]> wrote:
Denis Gantsev <[hidden email]> writes:
> Hello psql-novice
> I am trying to compile postgres with readline support, but no luck, even if
> I am pretty sure I have readline available...

You need to look further down than this:

> checking readline/readline.h usability... yes

specifically for a line like

checking for library containing readline... -lreadline

which I imagine is reporting "no" for you.

The most usual cause of this sort of problem is forgetting to install the
devel support package for readline (on most Linuxen you need something
like readline-devel or readline-dev, not just the base readline package).

However, the devel package is usually what provides the .h files too,
so I'm a bit mystified as to what's wrong.  Possibly, it'd be informative
to look into config.log to see what the underlying error report is for the
"library containing readline" test.

Also ...

denis ~/CProjects/postgres (REL_12_STABLE) $ pkg-config --libs
readline-L/usr/local/lib -lreadline

... you may need to say explicitly "--with-libraries=/usr/local/lib"
to get configure to look there for the library.  The default linker
configuration on Linuxen is not that friendly to putting libraries
outside the system library directory.

                        regards, tom lane

Hi Tom,
Thanks for help, I solved my issue... Which was indeed related with my own environment.
I looked more thoroughly into compilation log, which helped: I kept using the wrong binary. Also,
I had multiple readline installed (from sources), that added to confusion.

Regards
Denis