Я прочитал уже несколько постов, где у них были проблемы с подключением к postgres пользователю по умолчанию.
Однако в моем случае я могу без проблем подключиться к пользователю postgres
, но не могу войти в систему с моим пользователем по умолчанию windows. Когда я использую SQL Shell, он просто регистрирует меня в postgres пользователе.
Server [localhost]:
Database [postgres]:
Port [5432]:
Username [postgres]: maximilian
Password for user maximilian:
psql (12.1)
WARNING: Console code page (850) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page "Notes for Windows users" for details.
Type "help" for help.
postgres=# ----> As you can see still logged in as postgres user
Я настроен как пользователь в postgres, как показано ниже:
postgres=# \du
List of roles
Role name | Attributes | Member of
------------+------------------------------------------------------------+-----------
maximilian | Superuser | {}
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
Если я хочу использовать командную строку CMD psql
- Пользователь по умолчанию - Maximilian
и возвращает ошибку при вводе моего пароля.
C:\Users\Maximilian>psql --help
Connection options:
-h, --host=HOSTNAME database server host or socket directory (default: "local socket")
-p, --port=PORT database server port (default: "5432")
-U, --username=USERNAME database user name (default: "Maximilian")
-w, --no-password never prompt for password
-W, --password force password prompt (should happen automatically)
psql: error: could not connect to server: FATAL: password authentication failed for user "Maximilian"
psql
уже распознал Maximilian
как пользователя по умолчанию, прежде чем я создал эту роль / пользователя maximilian
в postgres.
Любая помощь высоко ценится!