Search code examples
postgresqlpasswordspsql

Pasting PostgreSQL user password does not work


I've got into strange issue, where I try to connect with specific user, using password via psql, but if I copy/paste password, it gives me this error:

Password for user myuser: 
psql: error: connection to server at "my-host" (192.168.1.154), port 5432 failed: FATAL:  password authentication failed for user "myuser"

I try to connect this way:

psql -U myuser -h myhost mydb

If I manually type password (without copy/pasting), I can connect without any issues:

Password for user myuser: 
psql (15.3 (Ubuntu 15.3-1.pgdg20.04+1), server 13.12 (Debian 13.12-1.pgdg120+1))
Type "help" for help.

mydb=> \q

Don't understand why simple copy does not work properly anymore for psql.

P.S. I use ubuntu 20.04 on my PC


Solution

  • After restarting Ubuntu and installing all pending updates, password copying started working.