skip to Main Content

So, I did some work on my Mac with PostgreSQL about 6-7 years ago. I am trying to get back into it and am following along with a tutorial. There are two issues that I have ran into regarding my pre existing configurations.

  1. I do not know the password I used when I originally set up PostgreSQL and the postgres user on my machine.
  2. I installed the latest version of PostgreSQL (15) from postgresapp.com but am getting the following error message:
    PostgreSQL version error

I tried steps I found on another stackoverflow question for uninstalling as well as running the following commands commands I used but this has not fixed the issue as when I install the latest version I get the same error mentioned in #2 above and the psql command still prompts me to enter a password that I do not remember.

Could someone help with providing the necessary steps to start "fresh" with PostgreSQL on mac or point me to an online resource that explains it? Everything I have found so far has not worked.

2

Answers


    1. Regarding your postgres user password, you can follow advice from this Stack Overflow question to change it. It’s pretty much the same steps, but with changing the postgreSQL configuration directory path on your machine. The key to solve your problem is to login on your system as a super user or root or whatever it is. and make sure it’s allowed {in your postgreSQL server configuration } to connect and login via unix socket without requiring the password.

    2. Regarding your version issue: install both version of PostgreSQL on your machine (the old one and the v15) then follow along with the official docs to migrate your database to work on latest versions. Another approach is to use pg_dump commands which you can search for its usage and manual online on the internet.

    Login or Signup to reply.
  1. If you don’t need any of the previous settings or data and you’re happy to delete them, you can try deleting the entire directory that was established the first time you installed Postgres.app.

    Can you open Postgres.app and look at your server settings, as in the screenshot below?

    enter image description here

    If so, that will tell you where your settings and data are being stored, For me, it’s in my home directory’s Application Support folder.

    As long as you’re 100% certain that you don’t need any of your previous data and settings, you should be able to delete the entire Postgres folder. Note: this will also delete any data/settings from the current version of postgres, but it doesn’t sound like that will be a problem for you.

    PS: I can see two weird red squares at the bottom of my screenshot which seems like something somewhere is not correctly handling the transparent parts of the PNG.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search