0

I'm trying to connect to my localhost Postgresql database and I'm getting an error:

Connection to database... failed

No other message provided.

I'm using using pgAdmin3 connecting to Postgresql 10.1

I've been connecting to this database using the same user (and password) and another user via my app successfully all the while but it just failed to connect to the database now. No users seems to be able to connect to the database

Edit: after further checks I noticed Postgresql is not listening on the port 5432.

I've checked the postgresql.conf file and it looks fine listen_addresses = '*', port = 5432

I'm kind of new to Postgresql. Sorry if it's something obvious I'm missing out. Still looking for how to start postgresql or make it listen on the port.

Jay_l
  • 1
  • 4
  • Is PostgreSQL running at all? What do the logs say? – Mike Sherrill 'Cat Recall' Jan 17 '18 at 19:05
  • Apparently PostgreSQL is not running. The last items on the logs say: LOG: received smart shutdown request LOG: worker process: logical replication launcher (PID 519) exited with exit code 1 LOG: shutting down LOG: checkpoint starting: shutdown immediate Still looking how to restart PostgreSQL. – Jay_l Jan 17 '18 at 20:05
  • Just to add i'm running PostgreSQL on macOS X. I've been searching for how to restart PostgreSQL with no solution yet. – Jay_l Jan 17 '18 at 20:21
  • It might depend on how you installed PostgreSQL. IIRC, it ships with OS X, but can also be installed with Homebrew, and I think you can get a PostgreSQL application, too. See https://stackoverflow.com/q/7975556/562459 for starters. Think about moving this question to dba.stackexchange.com. – Mike Sherrill 'Cat Recall' Jan 18 '18 at 04:16
  • Thanks @MikeSherrill'CatRecall'. I will move it to dba.stackexchange.com and i'm checking out the link you shared again. I had actually seen the question before but the answers provided didn't work when i tried them. – Jay_l Jan 18 '18 at 08:06
  • I'd expect restarting the computer to restart PostgreSQL. (Never underestimate the power of brute force.) I think "smart shutdown" implies a person initiated the shutdown. I could easily be wrong about that. – Mike Sherrill 'Cat Recall' Jan 18 '18 at 12:24
  • Thanks @MikeSherrill'CatRecall'. It's working now. Although this is after restarting my computer multiple times with no success. I decided to do a last restart try before reinstalling PostgreSQL and it worked. Not sure why it worked though maybe one of the solutions I tried. I will keep a close watch on the process this time. – Jay_l Jan 20 '18 at 08:06

0 Answers0