0

When I try to connect to the POSTGRESQL database, I get this error : SQLSTATE[08006] [7] FATAL: the role 'aurelien' does not exist

Here the dockercomposer.yml :

        - ROY_POSTGRESQL_ADDON_HOST=192.***.***
        - ROY_POSTGRESQL_ADDON_DB=******
        - ROY_POSTGRESQL_ADDON_PORT=5432
        - ROY_POSTGRESQL_ADDON_USER=aurelien

I have created my database, but when I connect to my database and i make '\d' :

          List of relations
 Schema |   Name   | Type  |  Owner
--------+----------+-------+----------
 public | wb_vente | table | aurelien

here are all the roles of my database:

                                  List of roles
Role name |                         Attributes                         | Member of
-----------+------------------------------------------------------------+-----------
aurel     |                                                            | {}
aurelien  |                                                            | {}
postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | {}

what can i do please?

All my pg_hba.conf and postgresql.conf files are well configured

  • Does this answer your question? [PostgreSQL error: Fatal: role "username" does not exist](https://stackoverflow.com/questions/11919391/postgresql-error-fatal-role-username-does-not-exist) – Wahyu Kristianto Mar 24 '23 at 12:35
  • If the role does not exist how are you connecting to the database to run `\d` and `\du`(for list of roles)? Best guess is the error is thrown when you try to connect to the database before the roles have been added to it. At that point you have to use the role created by the `initdb`, which is generally `postgres`. – Adrian Klaver Mar 24 '23 at 15:45

0 Answers0