DEV Community

Cover image for How To Access PostgreSQL Globally in Windows
Emmanuel Larbi
Emmanuel Larbi

Posted on

3 2

How To Access PostgreSQL Globally in Windows

If you are getting the error below after installing PostgreSQL don’t panic, just follow along with this tutorial and it’s gonna be solved.

Header image

This tutorial is simplified to help everyone to know how to add PostgreSQL to user or system variable(path) which can be accessed globally with minimum stress.

Let’s begin!

Normally, you will have to navigate to your PostgreSQL bin directory to copy the path which takes a while. Instead, I will provide the path for you to make everything quick and easy.

Path to postgresql bin directory —

C:\Program Files\PostgreSQL\14\bin
Enter fullscreen mode Exit fullscreen mode

NB: Change \14\ to the version of Postgres you have installed

Step 1

Copy the path to your Postgres bin directory provided above.

Step 2

Press the windows start button and search for env then click open

Search

Step 3

Click on Environment Variables

env

Step 4

Double click on Path

Path

Step 5

Click on New

Paste path

Step 6

Paste the [PostgreSQL bin](C:\Program Files\PostgreSQL\14\bin) path you copied. Then click ok recursively to close all windows

Paste path

Step 7

Close all instances of your terminal then reopen it.

NB: If you are using terminals in VS Code Editor, you will have to restart VS Code Editor for the changes to take effect

Postgres Accessed Globally

Step 8

You are done

And now you can log in to Postgres without using the default psql shell.

Hope this solves your issue about using Postgres globally.

Thank You

Jetbrains image

Build Secure, Ship Fast

Discover best practices to secure CI/CD without slowing down your pipeline.

Read more

Top comments (0)

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay