A super detailed beginner-friendly walk-through
Why install PostgreSQL on WSL 2?
Simply because the installation of PostgreSQL on Windows is kind of a pain, and I also use WSL 2 for other development tasks. You can visit my previous post on how to set up WSL 2.
I tried to download from the official website and install PostgreSQL 13.1 for Windows x86–64, and this was the error I couldn’t get rid of — Unable to write inside TEMP environment variable path.
After googling, I found a post that might be helpful for others, but it didn’t solve my problem. I was told to download 3rd party distributions and find a standalone version of PostgreSQL, and this installer works for me. This is the workaround if you have experienced the same issue but still want to install it on Windows.
Install PostgreSQL on WSL 2
Here comes the WSL 2, much easier, and you can visit the Windows WSL documentation for more detail.
- Open your WSL terminal (ie. Ubuntu 18.04).
- Update your Ubuntu…