How to add psql to path on windows

You need to set path for using psql on windows. You have to set the path for the psql on windows to be able to use postgresql from the command line.

  1. c> program files> PostgreSQL> bin> psql

  2. copy the path

  3. control panel> advanced system settings> Environment Variables> select Path from the system variables> Edit > New> Paste> Ok> OK> OK

this should be done

psql -U postgres -h localhost -W

Now give it your password. It should grant you access.

\l should print all the databases

\du should give you all the users.

Follow the previous tutorial to see how to grant roles and access.