Keyboard mapping for postgresql command line

Working with the setup I came across strange behahavior :
invoke the postgres with sudo -u postgres psql command the backslash key prints the hash character, the pipe ‘|’ character prints a tilde, the double quote prints the ‘@’. All other keys seem to work as expected.

Please advise.