Trying to set up PostgreSQL and failing

Hi all, I'm trying to get into databases, and PostgreSQL was recommended to me as a fairly easy one to learn, with some tutorials to work through. However, I'm running into some problems right off the bat, and a lot of searching hasn't yielded any results that have worked.

I am using a public wifi as I'm testing everything out, but most answers I saw didn't include that as a problem, or that it could be worked around by using a local database hosted on my hard drive (which I haven't gotten to yet because I'm stuck, see below).

Starting with PgAdmin 4, I try to run it but get the fatal error "The application server could not be contacted." I've tried uninstalling it and reinstalling it, but that hasn't helped. The most common answer was to make sure the config file had SERVER_MODE = False, which it is, but I still get the same error.

I tried using the psql command line, and that at least opens and I can log in, but I'm running into a wall there as well. I'm following this tutorial to start, but when trying to use >cd to load a database, I'm not getting any feedback, and I'm not sure if it's related to the problems I'm having with PgAdmin or not. The entire process has been very frustrating so far. :/

postgres-# >cd C:/Program Files/PostgreSQL/10/bin

postgres-# >cd C:\Program Files\PostgreSQL\10\bin

Invalid command \Program. Try ? for help.

Posted Nov 22, 2017, 2:31 PM UTC

114
Brjl•

Not sure why the tutorial doesn’t have them, but paths with spaces need to be wrapped in quotations for the CD command

CD “path to Postgres bin folder”

Keep the quotations.

2
AnandreOP•

I'll keep that in mind, thank you. I was trying that in psql even with quotes in a previous attempt, but as the other answer says, I needed to be doing it in the command prompt, not psql.

1
Medicalizawhat•

It looks like you are supposed to first navigate (in the command prompt) to 'C:\Program Files\PostgreSQL\9.5\bin'. In that directory is the pg_restore binary, which you can use to load the .tar file.

Those commands are not supposed to be executed from the psql prompt.

Also, FYI, commands in the psql prompt should be prefixed by a \ character, eg \cd.

2
AnandreOP•

Can't believe I didn't think to try that in cmd instead, thanks for the obvious answer. Think that worked, now to continue learning. :) Hopefully psql will work ok, a lot of tutorials seem to prefer PgAdmin.

1
Medicalizawhat•

PgAdmin is going to be easier to use psql can be a bit of a pain.

2
AnandreOP•

I was really hoping to use PgAdmin, but it's giving me a fatal error every time I try to use it. It says it can't connect to the server. :/

1
Medicalizawhat•

What error does it show?

2