PostgreSQL installation - terminal commands

Hey I had already downloaded the PostgreSQL to use it through PGAdmin, while following a different course, so I know it works. However there are two weird things happening:

  1. if I launch the Terminal and type psql there it says “command does not exist”, but then I found that if I do Applications --> PostgreSQL 12 --> SQL Shell (psql) a new terminal window is launched and this time it recognises the psql command. Do I have to do something within the “normal terminal” to connect to the shell besides just typing psql?
    *Screen Shot 2020-06-10 at 01.48.29 *
    Screen Shot 2020-06-10 at 01.49.53

  2. When I connect to my user, there is no prompt to type in a password -_o_/-

Why do these things happen? If I am a superuser i don’t need a password?


hey @bigflores1998

I have windows as os, so to launch psql I start from the root directory to the bin folder of PostgreSQL “C:\Program Files\PostgreSQL\12\bin” and then use the command psql

Also, I don’t have the latest version which I guess asks for password setup during installation. So I installed the older version and then used PgAdmin to set a password, which it does prompt anywhere I try to connect.

May be, in this case, the set password is taken behind-the-scenes when you try to login.

the links mentioned in this post might be helpful.

Hey thanks after your observation about the windows path i found that for mac this is the proper directory --> /Library/PostgreSQL/12/scripts/;

About the password though, is it a problem If my password is taken behind-the-scenes? I did indeed set it up during the installation process. Could I just leave it like this?

hi @bigflores1998

if it’s a learning database and stored locally then I don’t think it is big trouble.

however, you might wanna know its recovery steps or how to change the password and all in case you forget or it is required as part of learning administration-level tasks.

on an actual working database, you may have the connection string with parameters already encrypted although you may not know the actual password.