-1

I recently upgraded to postgresql 11.5. When I attempt to access my database i receive the error message "Not connected to the server or the connection to the server has been closed."

It had been working previously in the older version (11.4). I can see the table and columns in the tree menu. Tried going back to previous version but the problem remains. any thoughts on how to solve this? I'm using a localhost connection.

The table in question was created in QGIS and imported to Postgresql, but I don't think that is the issue.

rsarn
  • 1
  • 1
  • Are you able to use it with psql? – Murtuza Z Aug 28 '19 at 11:20
  • I'm new to postgres and don't know how to do that, hence my use of pgAdmin4. I can query the tables using the DB function within QGIS. When I update the tables, and refresh in pgAdmin4, the updates appear. See comments below. – rsarn Aug 29 '19 at 14:29

2 Answers2

0

Tried restarting the machine? Maybe qgis still thinks your connected. Did you try removing the connection from qgis and adding it again?

  • Yes and that did not solve the problem. I tried reinstalling postgres as well. I can query the db in QGIS using the DB Manger. The table appears in the tree on the left side of the screen, but when I try to access it in PGAdmin, I get the "not connected" error. I tried reinstalling postgresql but that didn't solve the problem. I need to find a way to start fresh with my db. Uninstalling postgres does not accomplish that. – rsarn Aug 22 '19 at 16:17
  • are you using the latest pgadmin? what OS are you using? did you try this? https://stackoverflow.com/questions/40083391/postgresql-cant-connect-application-server-through-pgadmin4 – strudelj nudelj Aug 23 '19 at 13:25
  • Just tried that and the server mode was already set to false. There was no folder for pgAdmin4 in the Apps/Roaming folder as shown in step 2. Could that be part of my problem? Note, when I add a table to my DB in QGIS, it appears in the tree and it even identifies the columns. That leads me to believe that QGIS is talking to postgresql but pgAdmin is not. I'm running this on Windows 10 and pgAdmin 4 installed with postgresql 11.4-2. – rsarn Aug 23 '19 at 19:04
  • In addition, I just tried disconnecting the server and reconnecting it through pgAdmin. When I did, I received the message that the server and DB were connected successfully; however I still cannot query the data. – rsarn Aug 23 '19 at 19:40
  • so we could assume that pgadmin is at fault here. Did you try using it trough a different browser? maybe try wiping anything related to pgadmin in your browsers cache/cookies? – strudelj nudelj Aug 24 '19 at 18:37
  • I just tried both. No luck. My only other thought is that something got corrupted when I upgraded t postgres 11.5 and wasn't recovered when I reinstalled the previous version. Also, how does pgAdmin know where the server and tables are located? If I could wipe that out and start with a new server, that might solve my problem. Since the tables I'm attempting to query are built in QGIS, it is easy to restore the db. Thanks for staying on this with me. – rsarn Aug 25 '19 at 16:50
  • I am not sure how it connects, maybe you could try to wipe out everything. It might have something to do with the upgrade. Hope you'll come to a resolution! – strudelj nudelj Aug 29 '19 at 15:03
  • maybe after update, the 11.4 database auto-migrated to another new database for 11.5 and some configuration didn't persist. Check the configuration file `postgresql.conf`, it might have different port number for example or the old database left there untouched and created a new one, so you are connecting with pgadmin to the old database and Qgis connects to the new one ... or something like this – Memos Electron Aug 29 '19 at 15:25
  • 1
    I noticed that a new version of pgAdmin (v.4.12) was released on 8/22 shortly after I encountered the problem. After reinstalling the new version and the problem was solved. Must have been a bug in the previous release. – rsarn Aug 30 '19 at 16:25
0

After much angst, I have finally solved this issue by simply reinstalling a new version of pgAdmin, which was released on 8/22. I don't know whether this was a bug in the previous version or if the reinstall itself fixed the problem. Thanks to all for your suggestions.

rsarn
  • 1
  • 1