咱們在PostgreSQL中使用\d命令,會有一個Access Privilieges的列數據庫
該列的含義以下app
rolename=xxxx -- privileges granted to a role =xxxx -- privileges granted to PUBLIC r -- SELECT ("read") w -- UPDATE ("write") a -- INSERT ("append") d -- DELETE D -- TRUNCATE x -- REFERENCES t -- TRIGGER X -- EXECUTE U -- USAGE C -- CREATE c -- CONNECT T -- TEMPORARY arwdDxt -- ALL PRIVILEGES (for tables, varies for other objects) * -- grant option for preceding privilege /yyyy -- role that granted this privilege
其中須要注意的是PUBLIC這個特殊的角色。this
按照文檔的說法PUBLIC這個角色是指數據庫中全部的角色,包括當前沒有,之後建立的出的新角色。code