Chris Hiestand <chiest...@salk.edu> writes:
> If I enter a unicode character in the psql cli, such as:
> user=# select 'ö';

> But before hitting enter, use the keyboard "left" button to move the cursor 
> across all the way to the left edge, and then back all the way to the right, 
> the output get distorted and looks like this:
> user=#select 'ö';;

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.8090...@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.

I'd strongly recommend installing the GNU readline library and rebuilding
psql against that.

                        regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to