- Install PostgreSQL server and tools
- Download installer here
- On the select componenets screen, select PostgreSQL Server, pgAdmin, and Command Line Tools
- Do not need Stack Builder
- Keep everything else as default
- Make sure you remember your the password you set
- Add PostgreSQL to path
- Find PostgreSQL bin folder
- Mine was
C:\Program Files\PostgreSQL\13\bin
- Mine was
- On windows search
pathin windows search - Click
edit system environment variables - Click
environment variables - Under
system variables, clickPath - Click
edit - Click
newand paste in the bin folder path - Hit
Okall the way down
- Start PostgreSQL server
- Find the PostgresSQL data folder
- Mine was
C:\Program Files\PostgreSQL\13\data
- Mine was
- Run
postgres -D "<path>"- For me
postgres -D "C:\Program Files\PostgreSQL\13\data"
- For me
- If the program terminates, something went wrong
- You want the program to not terminate after the command
- Sometimes it terminates, and I have no idea why, but I just messed around with it until it eventually didn't terminate
- Connect with
psqlto test that the server is working
- Run
psql -U postgres - Use password defined during step 1
- Should be met with a prompt like
postgres=# \lto list databases
-
To stop server, hit
Ctrl Cin the terminal window that is running the server -
To start the server, run the
postgres -D "<path>"command again, and if it doesn't terminate, it should be running