If unset, it will use the PostgreSQL user name also as the database name.
This is true, but its not what the docs says:
psql usage doc:
“The default user name is your operating-system user name, as is the default database name.”
Specifying -U doesn’t change one’s operating-system name, and the “as is” language is shorthand for “the default database name is your operating-system user name”.
David J.