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

From Chris Hiestand
Subject Re: postgres.app OS X psql character encoding (utf-8) problem
Date
Msg-id BE505697-8F54-481F-9044-88859DD41A02@salk.edu
Whole thread Raw
In response to Re: postgres.app OS X psql character encoding (utf-8) problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: postgres.app OS X psql character encoding (utf-8) problem
List pgsql-general
On Jan 9, 2014, at 1:09 PM, Tom Lane <tgl@sss.pgh.pa.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@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
bugreport along those lines. 

Thanks,
Chris

pgsql-general by date:

Previous
From: David Johnston
Date:
Subject: Re: Add custom properties to a column's definition (pg_attribute)
Next
From: "Day, David"
Date:
Subject: Re: pg_restore - selective restore use cases. HINT use DROP CASCADE