Thread: The dreaded readline, again, on OpenBSD

The dreaded readline, again, on OpenBSD

From
"Dr. Evil"
Date:
I'm trying to install PG on my new OpenBSD machine.  I installed the
latest version of GNU readline in the usual place (defaults to
/usr/local/...) and then I did ./configure in the src/ directory of
PG7.03.  This should have detected readline properly, but when I tried
psql, I couldn't use the history function.

So I cleared PG and did ./configure
--with-includes=/usr/local/include/readline and then I compiled again,
and this time, psql wouldn't compile at all, with this error:

tab-complete.c: In function `psql_completion':
tab-complete.c:230: `rl_completion_append_character' undeclared (first use in this function)

I know this is a FAQ, but I searched around the net and couldn't come
up with any answers.  Any ideas of how to get them to work together?

Thanks

Re: The dreaded readline, again, on OpenBSD

From
Tom Lane
Date:
"Dr. Evil" <drevil@sidereal.kz> writes:
> tab-complete.c: In function `psql_completion':
> tab-complete.c:230: `rl_completion_append_character' undeclared (first use in this function)

I think you're suffering from interference between new and not-so-new
versions of libreadline, though it's hard to see exactly how you got
this error given your procedure.  You should definitely remove any
older readline.h and history.h include files that may be lurking on
your system, because evidently they're getting found somehow.

Another possibility, given that you're on BSD, is a conflict against
libedit (the BSD sort-of-workalike).

            regards, tom lane

Re: The dreaded readline, again, on OpenBSD

From
Patrick Welche
Date:
On Wed, Apr 04, 2001 at 11:24:45PM -0000, Dr. Evil wrote:
>
> tab-complete.c: In function `psql_completion':
> tab-complete.c:230: `rl_completion_append_character' undeclared (first use in this function)

What sources are you using? (ISTR that references to
rl_copletion_append_character were removed sometime in January...)

Cheers,

Patrick

The answer for gnu readline4.1 + OpenBSD2.8 + PG7.03

From
"Dr. Evil"
Date:
Here's what I had to do to get Postgresql 7.03 to detect the gnu
readline lib on OpenBSD 2.8.

1. Install the GNU readline lib.  I got version 4.1, which is
   current.  It installs itself in /usr/local.

2. OpenBSD comes with some readline libs already, but I think these
   are old versions, or they don't work so well, so I got them out of
   the way: mv /usr/include/readline /usr/include/readline.old and mv
   /usr/lib/libreadline.a /usr/lib/libreadline.a.old.

3. ./configure will not detect the new readline stuff in /usr/local/,
   so I had to do ./configure --with-lib=/usr/local/lib
   --with-includes=/usr/local/include.

4. Then make it normally, and everything will work, and you've got
   most up-to-date readline lib.

If you're using Postgres psql without readline support, you should try
to install it because it makes interactive sessions much easier.

Thanks for all the help from the PG list.