Six things that surprised me while setting up PostgreSQL on Ubuntu
I learnt MySQL in a coursework, and that is as far as my database experience goes. Then I installed PostgreSQL 18.6 on Ubuntu 26.04 (running under WSL2 on Windows) and wrote a setup guide for MySQL users while I did it. I must say, PostgreSQL surprised me more than once.
This is what tripped me up, so I'm giving you a heads up. A note on sources: I ran every PostgreSQL command below on my own install. I did not run MySQL for this article, so where I describe MySQL's behavior, Just know I checked it against the official MySQL documentation.
1. There is no mysql -u root -p
In MySQL you log in as a named user with a password. On a fresh PostgreSQL install on Ubuntu, you do this instead:
sudo -u postgres psql
Enter fullscreen mode
Exit fullscreen mode
You run psql as the Linux user called postgres , and your prompt changes to postgres=# .…