PostgreSQL is one of the most popular database systems available today. In this guide, we’ll walk you through how to install Postgres on Windows.
You can find an installer for the latest Postgres version on the EnterpriseDB website. Select a version for Windows x86_64 and download the installer.
Once the file has downloaded, open it to begin installation. When prompted, select the components you want to install. We recommend selecting ‘PostgreSQL Server’ and ‘Command Line Tools’:
When prompted, enter a root password for your PostgreSQL server. You must note this password in order to make the initial connection
Confirm that PostgreSQL is running by opening ‘Run’ and typing in services.msc
. Postgres should be in the list as postgresql-x64-13
:
Now, let’s connect! Open Arctype, press Add New Connection, and enter your connection information. For now, we’ll use the postgres
user with the password set during installation and the database postgres
:
Press Test Connection to confirm that all of your information is correct and then Save!
Now that you have connected, you should make a few changes to improve the security of your database. The first is to create a new database that is separate from the mysql informational database you are currently connected to. Click ‘New Query’ and run the following command:
CREATE DATABASE myDB
Next, you should create a new user:
CREATE USER myUser WITH PASSWORD ‘myPassword’
And finally, you’ll need to grant this user full permissions on your database:
GRANT ALL PRIVILEGES ON myDB TO myUser
Go back to the settings menu in your SQL client and switch to this new user and database. You’re all ready to start writing queries!