ERROR: invalid locale name: \"en_US.utf-8\"
Running Ubuntu server 18.04 Beta 2 with PostgreSQL 10.
In running a database creatio
I had the same error, I generated the new locale:
locale-gen en_US.UTF-8
I verified with locale -a that it was in fact present, then I logged out just to make sure, but I was still getting the same error on the database creation.
Finally, I solved the error by simply restarting the postgresql server with:
sudo systemctl restart postgresql
After that, the database creation command was working!