Postgres migration local to remote, issue with terminal command
Having two programs in the same pipeline both trying to prompt for a password at the same time is confusing your terminal.

There may be a shell-specific way to fix this, but I'd fix it at the PostgreSQL level by either changing the local server to use an authentication method that doesn't need a password, or making a .pgpass file to accommodate the local connection (and maybe the remote connection, too).

For what it is worth, a shell way to get around this would be:

pg_dump -C -h localhost ... | (sleep 10; psql -h ...)


Where the sleep gives you enough time to enter the local password.