HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Postgres revoke database access from user

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
postgresuserrevokedatabasefromaccess

Problem

When I tried

REVOKE ALL PRIVILEGES ON DATABASE postgres from admin;


but the user admin is still able to connect to postgres remotely via pgadmin after that.

How do I completely revoke an user's access to a database?

Log: https://pastebin.com/raw/Q2mfkf3P

Solution

The right to connect is by default granted to PUBLIC. You would have to revoke it from PUBLIC (and then grant it individually to other users who need it) to accomplish what you want.

Or use pg_hba.conf to deny the connection.

Context

StackExchange Database Administrators Q#199875, answer score: 3

Revisions (0)

No revisions yet.