January 2019
Beginner
556 pages
14h 19m
English
To disallow users from connecting to the database by default, you need to revoke the default database permissions from the public, as follows:
car_portal=# REVOKE ALL ON DATABASE car_portal FROM public;REVOKEcar_portal=# \q$ psql car_portal -U web_app_userpsql: FATAL: permission denied for database "car_portal"DETAIL: User does not have CONNECT privilege.
To allow the user to connect to the database, the connect permissions should be granted, as follows:
postgres=# GRANT CONNECT ON DATABASE car_portal TO web_app_user;GRANTpostgres=# \l car_portal List of databases-[ RECORD 1 ]-----+----------------------------------Name | car_portalOwner | car_portal_appEncoding | UTF8Collate | en_US.UTF-8Ctype | en_US.UTF-8Access ...
Read now
Unlock full access