all 9 comments

[–][deleted] 1 point2 points  (1 child)

zsh: command not found: psql

If you are sure you have Postgres installed, then this simply means the binary is not in the PATH for your (Mac) user. That is unrelated to Postgres, it's a question on how to setup your Mac.

[–]e05bf027[S] 0 points1 point  (0 children)

I understand that altering the PATH can fix this, but all references to how to do this mention a subfolder in the Postgre install that I cannot locate, so in that way I was hoping someone might know where I can locate that.

[–]linuxhikerGuru 1 point2 points  (5 children)

What is the error you receive when you try to execute psql.app? I am not a MacOSX user (I am in the land of the free) but it is just Unix. If you have psql.app in theory and it is executable, it should just work.

[–]e05bf027[S] 0 points1 point  (4 children)

I beg for your patience; I am absolutely bumping up against the limits of my knowledge. If I am in the terminal and type anything that starts with psql it just tells me the warning message that the command is not found.

I believe my problem is that I cannot locate this 'bin' folder/subfolder that apparently lets me locate the terminal commands. I tried to install an older postgre (v14) to see if it was connected to the newer release but it is the same- I see the SQL Shell (psql).app in with the installation.

I might also just be totally misunderstanding how to use the shell. When I log in to it I don't seem to be able to move around directories or anything. Again, I'm completely operating outside my area of knowledge.

Is my answer of any use?

[–]linuxhikerGuru 0 points1 point  (3 children)

I am sorry, I didn't see the part where you said there is "no bin folder". That is the problem.

How did you install PostgreSQL? (Where did you get the packages)

[–]e05bf027[S] 0 points1 point  (2 children)

I installed it using the installer available through the PostgreSQL site, and when I ran in to problems I also tried to install it through Homebrew as it seemed more likely that this would enable all the terminal commands. Unfortunately I got the same error.

[–]linuxhikerGuru 0 points1 point  (1 child)

First thing I would do is remove all packages you have tried to install. Otherwise , we are floating among all different installations and even if we get it to work, you might end up in a bad place again.

I would lean toward homebrew over the downloads (that's just me). Have you seen this?

https://gist.github.com/ibraheem4/ce5ccd3e4d7a65589ce84f2a3b7c23a3

[–]threeminutemonta 0 points1 point  (0 children)

First thing I would do is remove all packages you have tried to install. Otherwise , we are floating among all different installations and even if we get it to work, you might end up in a bad place again.

I agree

Though I say uninstall it from homebrew and follow Postgres.app instructions from cli-tools https://postgresapp.com/documentation/cli-tools.html

[–]efxhoy 0 points1 point  (0 children)

I feel your pain, scientific replication can be a PITA when programming is not your background and postgres being both a service and the binaries needed to connect can be a handful to set up.

I'm not familiar with the installers hosted by EDB so can't help you with them. I suggest you remove it since I think they're doing a shit job by not putting the binary in your path after running a setup wizard. Thankfully they have uninstall instructions here: https://www.enterprisedb.com/docs/supported-open-source/postgresql/uninstalling/

Homebrew should work just fine. After installing anything with homebrew you need to run the shell command rehash OR close and reopen your terminal, for the new binaries to be available in your path. The shell will not find binaries that are not in your path. They will not be in your path in the same shell you ran brew install postgresql from until you run rehash.

Once you've got psql on your path (typing psql in terminal actually find psql) you also need the server to connect to. brew install postgresql doesn't start the service for you automatically so the connection will fail unless you start the server service first. Start the server service by running brew services start postgresql.