0

After i try $ sudo -u postgres createuser --interactive

it promts me with the name and superuser option (which I say yes)

then I get this error

createuser: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: role "my-user" does not exist

my-user is the name I gave it when prompted for a name and it is the same user I have on the WSL terminal, I have done this previously with no problem so I don't think it matters.

I am a little bit lost on what the problem even is. I don't know if the problem is the linux user or the user being created in postgres

I also have searched for solutions but none land quite the same way as mine is landing

Help or guidence would be apretiated!

I have tried givin the folder permissions, I have tried re-installing postgres, rebooting

Following this post mostly How do I solve this problem to use psql? | psql: error: FATAL: role "postgres" does not exist

por it does nothing

The first time i did it i got this error instead could not change directory to "/home/user" which i solved with this https://dba.stackexchange.com/questions/54242/cannot-start-psql-with-user-postgres-could-not-change-directory-to-home-user

tink
  • 14,342
  • 4
  • 46
  • 50
andresnb
  • 1
  • 1
  • After looking into it more and trying more solutions the problem was the first install that created a user without folder permission and it was like "hanging there doing nothing" Could not drop it, assign a role or anything. The solution was to uninstall psql COMPLETELY following this post: https://kb.objectrocket.com/postgresql/how-to-completely-uninstall-postgresql-757 after that reinstalling following this https://www.postgresql.org/download/linux/ubuntu/ – andresnb Mar 30 '23 at 21:33

1 Answers1

0

After looking into it more and trying more solutions the problem was the first install that created a user without folder permission and it was like "hanging there doing nothing" Could not drop it, assign a role or anything.

The solution was to uninstall psql COMPLETELY following this post: kb.objectrocket.com/postgresql/…

After that reinstalling following this: postgresql.org/download/linux/ubuntu

andresnb
  • 1
  • 1
  • Instead of linking please, define the steps needed to uninstall and install again in the answer. – Luke 10X Apr 05 '23 at 14:46
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 05 '23 at 14:46