PostgreSQL Fatal Error: Username Role Does Not Exist

I am setting up my PostgreSQL 9.1 in windows.

I can not do anything with PostgreSQL: I can not createb, I can not createuser; all operations return an error message

Fatal: root role does not exist
root is my account name that I created when installing Postgresql

But I can connect using:

  username : postgres 

How to connect to postgres using the root role?
There is a solution mentioned for Linux platforms using the su command here , but not able to find a solution for windows7

Thanks at Advance

+5
source share
1 answer

If you want to log in to Postgres using the root username, you need to create one first.

First you need to log in as a Postgres user. This is usually postgres (and is specified during installation):

 psql -U postgres .... 

then you can create roles and databases:

 psql (9.4.0) Type "help" for help. postgres=# create user root with password 'verysecret'; CREATE ROLE postgres=# \q c:\ c:\>psql -U root postgres psql (9.4.0) Type "help" for help. postgres=> 

As the superuser, you can also grant the root necessary privileges.

All parameters for psql described in the manual .

Creating users and databases is also described in the manual:

+20
source

Source: https://habr.com/ru/post/1212434/


All Articles