From: | "William Sescu (Suva)" <william(dot)sescu(at)suva(dot)ch> |
---|---|
To: | "'pgsql-admin(at)lists(dot)postgresql(dot)org'" <pgsql-admin(at)lists(dot)postgresql(dot)org> |
Subject: | SELECT has_database_privilege('user01', 'db01', 'connect'); |
Date: | 2022-04-28 09:47:00 |
Message-ID: | b8add1f8cc9b4f3db199855deea55594@suva.ch |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
Hello %
I am kinda confused, if I miss something. I have two questions:
* A new created user should not have the connect privilege per default, if the user is not the owner of the db, right?
* The function has_database_privilege should return false, if I revoke the connect privilege, right?
(postgres(at)[local]:55042)[postgres]> CREATE USER user01 ENCRYPTED PASSWORD 'user01';
CREATE ROLE
(postgres(at)[local]:55042)[postgres]> CREATE DATABASE db01 WITH OWNER = postgres;
CREATE DATABASE
(postgres(at)[local]:55042)[postgres]> SELECT has_database_privilege('user01', 'db01', 'connect');
has_database_privilege
------------------------
t <= have expected false here
(1 row)
(postgres(at)[local]:55042)[postgres]> REVOKE CONNECT ON DATABASE db01 FROM user01;
REVOKE
(postgres(at)[local]:55042)[postgres]> SELECT has_database_privilege('user01', 'db01', 'connect');
has_database_privilege
------------------------
t <= have expected false here even more after the revoke statement
(1 row)
Or do I have some misunderstanding in regards of how it should work?
Cheers,
William
________________________________
Disclaimer:
Diese Nachricht und ihr eventuell angehängte Dateien sind nur für den Adressaten bestimmt. Sie kann vertrauliche oder gesetzlich geschützte Daten oder Informationen beinhalten. Falls Sie diese Nachricht irrtümlich erreicht hat, bitten wir Sie höflich, diese unter Ausschluss jeglicher Reproduktion zu löschen und die absendende Person zu benachrichtigen. Danke für Ihre Hilfe.
This message and any attached files are for the sole use of the recipient named above. It may contain confidential or legally protected data or information. If you have received this message in error, please delete it without making any copies whatsoever and notify the sender. Thank you for your assistance.
From | Date | Subject | |
---|---|---|---|
Next Message | Les | 2022-04-28 09:52:10 | Hot standby writable? |
Previous Message | Adelino Silva | 2022-04-28 09:22:35 | RE: Postgres Stale Statistics |