psql with diacritical marks on Mac OS X 10.6.4

If you're typing diacritical marks (ăâșt) into the psql command line on Mac OS X 10.6.4 and getting question marks in place of the expected marks, you're facing a problem in the libedit library used by psql for enhanced command line editing.

You can tell psql to stop using the libedit library, using a command line option:

Input and output options:
[..]
-n, --no-readline disable enhanced command line editing (readline)


The disadvantage is that psql will loose all enhanced editing features (such as going to the begging of the line by typing Ctrl+A). To get around this problem, I usually run two psql sessions, one without read line capabilities (the "Romanian session") and one with enhanced editing features (the "normal session").

The 10.6.4 libedit library also causes crashes when using TAB completion on some object names. Reference here: archives.postgresql.org.