0

After a server failure I'm not able to execute psql like psql -U postgres nor like sudo -u postgres psql. In both cases I'm asked for the user password despite I've modified the pg_hba.conf files to trust all local connections and I've tried virtually all proposed solutions along the web. Would it be possible to delete the postgres user and re-create it without loosing the data? That's assuming the issue might be that the user got corrupted during the system failure.

Detailed info

  • Logs at /var/lib/pgsql/15/data/log are all empty.
  • Service status looks like: enter image description here
  • /var/lib/pgsql/15/data/pg_hba.conflooks like -after some changes to try to login wihout password: enter image description here
  • /var/lib/pgsql/data/pg_hba.conf looks like: enter image description here
4
  • 1
    For PostgreSQL, the user name postgres is just a string; deleting the actual Linux user account and creating another one with the same name won't change the way PostgreSQL treats that user. If you want help, you should provide more details (the entire shell session, including the error message; the pg_hba.conf file; errors logged by the Postgres server in its log file; etc.) Commented Oct 15, 2024 at 16:30
  • Thanks @mustaccio. I've edited the question to add the data I can find. Commented Oct 16, 2024 at 16:40
  • The relevant log file is probably in /var/log... Commented Oct 16, 2024 at 18:12
  • Thanks again @mustaccio. I can't find any postgresql logs under /var/log unfortunately. Commented Oct 17, 2024 at 17:32

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.