Re: postgres.app OS X psql character encoding (utf-8) problem

From: Chris Hiestand <chiestand(at)salk(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: postgres.app OS X psql character encoding (utf-8) problem
Date: 2014-01-09 21:49:35
Message-ID: BE505697-8F54-481F-9044-88859DD41A02@salk.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Jan 9, 2014, at 1:09 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> What this sounds like is that the readline or libedit library doesn't
> understand multibyte characters properly. psql itself doesn't have
> anything to do with the display of un-entered lines, but relies on
> one of those libraries to manage input editing.
>
> The default situation on OS X is generally that psql gets linked against
> the Apple-supplied libedit, which goes so far as to masquerade as
> readline. Check "otool -L /path/to/psql"; if you see a reference to
> /usr/lib/libedit.3.dylib, or to /usr/lib/libreadline.dylib
> (which is really just a symlink to the former), then that's what you've
> got. While I'm generally a fan and user of Apple stuff, their version
> of libedit is just abysmal; we've seen random crashes, complete failure
> of tab completion, and other bugs in successive OS X releases. I also
> find specific references to multibyte input being busted in other
> distros' versions of libedit, eg
> http://www.postgresql.org/message-id/4D5B2C5A.8090506@catalyst.net.nz
> so it may not be all Apple's fault; but they definitely have a track
> record of shipping broken versions of libedit.

Thanks Tom Lane. It's useful to know that one of these handles unentered text.

postgres93.app is supplied with its own version of libedit.

user(at)hostname:~ $ otool -L `which psql`
/Applications/Postgres93.app/Contents/MacOS/bin/psql:
/Applications/Postgres93.app/Contents/MacOS/lib/libpq.5.dylib (compatibility version 5.0.0, current version 5.6.0)
/Applications/Postgres93.app/Contents/MacOS/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/Applications/Postgres93.app/Contents/MacOS/lib/libedit.0.dylib (compatibility version 1.0.0, current version 1.45.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)

Do you think this an indication that the app bundle may have been compiled with a bad version of libedit? I can file a bug report along those lines.

Thanks,
Chris

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Day, David 2014-01-09 21:51:39 Re: pg_restore - selective restore use cases. HINT use DROP CASCADE
Previous Message David Johnston 2014-01-09 21:14:32 Re: Add custom properties to a column's definition (pg_attribute)