I have seen all the questions here on stackoverflow about similar topic, but I would like to know why this happens, where is the problem, and what to do to set it up correctly. I am learning to code, so I apologize for any misunderstandings. Please, have patience with me.
My case is -
I cannot run psql
command from terminal.
Respond is -
psql: FATAL: role "some_name" does not exist
after I write down and hit enter -
sudo -u postgres -i
everything just works and I can run psql
command. I need to write sudo -u postgres -i
command every time I open terminal, again and again.
I would like to kindly thanks to any respond.
If you got more questions I can give you more information.
Here see some additional info:
[postgres@localhost ~]$ psql
psql (9.6.6)
Type "help" for help.
postgres=# \du
List of roles
Role name | Attributes | Member
of
-----------+------------------------------------------------------------+-------
----
matus | | {}
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
Another:
[postgres@localhost ~]$ whoami
postgres
So, I have two opened terminals, one as postgres
and another as user_name
where I can do other stuff, using db somehow.