Postgresql grants default privileges on some types of objects to
PUBLIC
. No privileges are granted toPUBLIC
by default on tables,columns,schemas or tablespaces. For other types,the default privileges granted toPUBLIC
are as follows:CONNECT
andCREATE TEMP TABLE
for databases;EXECUTE
privilege for functions; andUSAGE
privilege for languages. The object owner can,of course,REVOKE
both default and expressly granted privileges. (For maximum security,issue theREVOKE
in the same transaction that creates the object; then there is no window in which another user can use the object.) Also,these initial default privilege settings can be changed using the 07001 command.
要删除数据库上所有未指定用户的所有权限(包括CONNECT),请使用:
REVOKE ALL PRIVILEGES ON DATABASE <database> FROM public;
也可以看看:
> PostgreSQL: View database connect permissions
> http://wiki.postgresql.org/wiki/Shared_Database_Hosting