Question

I upgraded the PostgreSQL database from version 10 to 11. As I tried to access the database from a client pgadmin4 console, I got the below error:

enter image description here

I checked the two file postgresql.conf and pg_hba.conf in the system. However, when I tried to open the pg_hba.conf file, it comes up blank. I followed the steps for the upgrade (for Ubuntu users)in the link below:

https://stackoverflow.com/questions/24379373/how-to-upgrade-postgresql-from-version-9-6-to-version-10-1-without-losing-data

I know this error might get resolved if I allow privileges in the pg_hba.conf file. But that file does not show any data in it. I am a beginner in setting up database servers and could have unknowingly skipped something which I cannot figure out. Can anyone please help me with this?

Adding the image for pg_hba.conf file:

enter image description here

Was it helpful?

Solution

Upgrading a database with either dump/restore or pg_upgrade will not copy the configuration files, so you are left with whatever pg_hba.conf was there right after initdb created the new cluster.

You have to edit and adapt postgresql.conf and pg_hba.conf and other configuration files you use manually on the new cluster. With pg_hba.conf copying the file over is usually good enough, but postgresql.conf requires more attention.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top