Malik Rumi <malik.a.rumi@gmail.com> writes:
> [ assorted misbehavior ]
> Can someone tell me a) what is going on here and b) how to fix it? Thanks.
What it looks like is that psql has the wrong idea about what sort of
terminal you're using (ie, which command language your terminal
window understands). With no more info than that you're on Ubuntu,
it's hard to be more specific than that. But try "echo $TERM" at the
shell command line to see what psql is being told about this, and then
see if that squares with the documentation about your terminal program.
regards, tom lane