_partials/windows_postgresql.md
Sometimes, SQLite is not enough and we will need a more advanced tool called PostgreSQL, an open-source robust and production-ready database system.
Let's install it now.
Run the following commands:
sudo apt install -y postgresql postgresql-contrib libpq-dev build-essential
sudo /etc/init.d/postgresql start
sudo -u postgres psql --command "CREATE ROLE \"`whoami`\" LOGIN createdb superuser;"
📝 If you get an error saying could not change directory to "/home/your_name": Permission denied that is totally fine, and there's no need to worry 💆 If, on the first run, it says CREATE ROLE in the end all worked fine.
You can configure PostgreSQL to autostart, so you don't have to execute sudo /etc/init.d/postgresql start each time you open a new terminal:
sudo echo "`whoami` ALL=NOPASSWD:/etc/init.d/postgresql start" | sudo tee /etc/sudoers.d/postgresql
sudo chmod 440 /etc/sudoers.d/postgresql
echo "sudo /etc/init.d/postgresql start" >> ~/.zshrc
Open a new terminal.
:heavy_check_mark: If you see a * Starting postgresql (via systemctl): postgresql.service OR * Starting PostgreSQL 14 database server message, you're good to go :+1:
:x: If not, contact a teacher.