I just switched/updated to the PostgreSQL packages from apt.postgresql.org
(instead of Ubuntu's own packages) and now all is working as advertised.
I had done some debugging in psql/prompt.c and indeed the
RL_PROMPT_START_IGNORE section was executing. So I never quite got to the
bottom of it, but am content to just to run with the updated packages.
Thanks for your help.
Robert