Re: postgres (superuser) cannot connect to database

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: postgres (superuser) cannot connect to database
Дата
Msg-id e0b3128f9c5b6a4f3d7a0274b38a952632821fe0.camel@cybertec.at
обсуждение исходный текст
Ответ на postgres (superuser) cannot connect to database  (Holger Jakobs <holger@jakobs.com>)
Список pgsql-admin
On Wed, 2022-11-23 at 13:41 +0100, Holger Jakobs wrote:
> How come a user who has issued "set role to postgres", so that the 
> current user is postgres, cannot connect to a database?
> 
> Are superuser rights not sufficient?
> 
> student@[local]:5434//~:=# \c einkauf
> Verbindung zum Server auf Socket »/var/run/postgresql/.s.PGSQL.5434« 
> fehlgeschlagen: FATAL:  keine Berechtigung für Datenbank »einkauf«
> DETAIL:  Benutzer hat das CONNECT-Privileg nicht.
> Vorherige Verbindung wurde behalten
> student@[local]:5434//~:=# grant connect on database einkauf to postgres;
> GRANT
> student@[local]:5434//~:=# \c einkauf
> Sie sind jetzt verbunden mit der Datenbank »einkauf« als Benutzer »student«.
> student@[local]:5434//einkauf:=>
> 
> Who can explain this? It's version 15 I'm using for the first time, 
> haven't checked with oder versions.

PostgreSQL doesn't use the current role for the new connection, but the
role you used to authenticate originally.

See \conninfo or "SELECT session_user;" to see that role.

Yours,
Laurenz Albe



В списке pgsql-admin по дате отправления:

Предыдущее
От: Holger Jakobs
Дата:
Сообщение: postgres (superuser) cannot connect to database
Следующее
От: Tom Lane
Дата:
Сообщение: Re: postgres (superuser) cannot connect to database