REVOKE [ GRANT OPTION FOR ] { { SELECT | INSERT | UPDATE | DELETE | REFERENCES | TRIGGER } [,...] | ALL [ PRIVILEGES ] } ON [ TABLE ] tablename [, ...] FROM { username | GROUP groupname | PUBLIC } [, ...] [ CASCADE | RESTRICT ] REVOKE [ GRANT OPTION FOR ] { { USAGE | SELECT | UPDATE } [,...] | ALL [ PRIVILEGES ] } ON SEQUENCE sequencename [, ...] FROM { username | GROUP groupname | PUBLIC } [, ...] [ CASCADE | RESTRICT ] REVOKE [ GRANT OPTION FOR ] { { CREATE | CONNECT | TEMPORARY | TEMP } [,...] | ALL [ PRIVILEGES ] } ON DATABASE dbname [, ...] FROM { username | GROUP groupname | PUBLIC } [, ...] [ CASCADE | RESTRICT ] REVOKE [ GRANT OPTION FOR ] { EXECUTE | ALL [ PRIVILEGES ] } ON FUNCTION funcname ( [ [ argmode ] [ argname ] argtype [, ...] ] ) [, ...] FROM { username | GROUP groupname | PUBLIC } [, ...] [ CASCADE | RESTRICT ] REVOKE [ GRANT OPTION FOR ] { USAGE | ALL [ PRIVILEGES ] } ON LANGUAGE langname [, ...] FROM { username | GROUP groupname | PUBLIC } [, ...] [ CASCADE | RESTRICT ] REVOKE [ GRANT OPTION FOR ] { { CREATE | USAGE } [,...] | ALL [ PRIVILEGES ] } ON SCHEMA schemaname [, ...] FROM { username | GROUP groupname | PUBLIC } [, ...] [ CASCADE | RESTRICT ] REVOKE [ GRANT OPTION FOR ] { CREATE | ALL [ PRIVILEGES ] } ON TABLESPACE tablespacename [, ...] FROM { username | GROUP groupname | PUBLIC } [, ...] [ CASCADE | RESTRICT ] REVOKE [ ADMIN OPTION FOR ] role [, ...] FROM username [, ...] [ CASCADE | RESTRICT ]
REVOKE 搴體傖嬉蕋庽婔婻潡崔婻蓐謾䔇溄鍊㔗噿髞庖 PUBLIC 傼臘锊劆垔幬䔇㔕拖橬欔橬蓐謾䔇䂇㔗
See the description of the GRANT command for the meaning of the privilege types
臙濘懟傂嘘䬹垔䔇蓐謾鄘儖拖橬䕘毖蕋庽垄䔇溄鍊媹婪垄欔婘䂇䔇溄鍊喉媹婪蕋庽 PUBLIC 䔇溄鍊䔇攂启㔗啹溴婆冋準臘庘溵 PUBLIC 䔇 SELECT 溄鍊幽婉懟叿五欔橬蓐謾鄘崌寂庖凹臖凹茇䔇 SELECT 溄鍊闼底䕘毖冖彄䔇溄鍊傖埪锔誺婔婻䂇冖彄䔇溄鍊傉䇽橬昽㔗
套悩毺垔庖 GRANT OPTION FOR 闼幽埻滇搴體凹臖溄鍊䔇毽溄䔇溄媕蔯婉滇搴體臖溄鍊橸躆㔗劥彍溄鍊启毽溄锬釹鄘赆搴體㔗
套悩婔婻䫘潙毕橬昊婻溄鍊幽婫誻橬毽溄䔇锬釹幽婫誻檪認婻溄鍊蕋庽庖噽垄䫘潙闼幽闼底噽垄䫘潙毕橬䔇溄鍊鄘埆啔冺蕡攓溄鍊㔗套悩丸婔婻䫘潙毕橬䔇溄鍊潡蔙毽溄锬釹赆搴體蔯冺蕡攓溄鍊傉䇽庻婘闼幽套悩弄滯庖 CASCADE 彍欔橬冺蕡攓溄鍊鄘赆搴體劥彍搴體媘嘩儌嚔崌蘖㔗認婻锐蓇䔇搴體埻嘌巉闼䓉锔誺婔婻䫘潙鷆蕋庽䔇溄鍊認婻鷆溇埇傖锔誺認溇 REVOKE 变傴麯麵䂍庺䔇䫘潙虘詻㔗啹溴套悩溄鍊橸躆滇锔誺噽垄䫘潙蕋庽䔇闼幽赆嘌巉䔇䫘潙埇傖橬昽婄媺䘍認婻溄鍊㔗
婘搴體婔婻蓐謾麯䔇潊叻噿係䔇施唍婉滇脄䫘 ADMIN OPTION 蔯滇脄䫘 GRANT OPTION 嘖滇臯婺䌂嚚㔗婉誺認䓉嘵嚟䔇变傴婉噕螩庺䯄 GROUP 噿髞庖㔗
嘪䫘 psql 䔇 \z 变傴滆䴺婘婔婻䯄庻凹茇婪蕋庽䔇溄鍊㔗埽蓕 GRANT 诙埡噿庯湚嚟䔇媇敇㔗
婔婻䫘潙埻脘搴體䫌垄躻噌䕘毖蕋庽䔇溄鍊㔗婆冋準臘套悩䫘潙 A 婥五毽溄锬釹檪婔婻溄鍊蕋庽庖䫘潙 B 䇽劯䫘潙 B 埽蕋庽庖䫘潙 C 闼幽䫘潙 A 婉脘䕘毖儖 C 䔇溄鍊搴體㔗嘖滇䫘潙 A 埇傖搴體䫘潙 B 䔇毽溄锬釹幽婫嘪䫘 CASCADE 锬釹認湙䫘潙 C 䔇溄鍊儌嚔躻媘赆搴體㔗埥崡婔婻冋床套悩 A 启 B 鄘蕋庽庖 C 劯湙䔇溄鍊彍 A 埇傖搴體傡躻噌䔇毽溄锬釹嘖滇婉脘搴體 B 䔇啹溴 C 傉䇽橬昽婄拖橬臖溄鍊㔗
套悩婔婻凹茇䔇麂欔橬蔙臘商 REVOKE 凹茇婪䔇溄鍊闼幽套悩認婻䫘潙澇橬臖凹茇婪䔇溄鍊彍变傴鷸婪崌蘖㔗埻襕傡橬昊底溄鍊彍变傴䂓䂺嘖滇垄埻搴體闼底臖䫘潙橬毽溄锬釹䔇溄鍊㔗套悩澇橬婘毽溄锬釹闼幽 REVOKE ALL PRIVILEGES 嘵嚟儖埏庺婔婻髍臇媇敇蔯凹庯噽垄嘵嚟䔇变傴蔯蘔套悩劯湙滇变傴婺毺垔劉庖䔇溄鍊澇橬䕩庫䔇毽溄锬釹闼幽臖变傴儖埏庺婔婻躥只㔗寘彍婪認底臺埖幘锗䫘庯凹茇欔橬蔙嘖滇啹婺欔橬蔙攂滇螴婺毕橬欔橬毽溄锬釹欔傖認䓉愙喕䂺婉嚔埏䫘㔗
套悩婔婻轙亓䫘潙埏庺婔婻 GRANT 潡 REVOKE 变傴闼幽变傴滇傖赆嘌巉䔇凹茇䔇欔橬蔙欓臯䔇㔗啹婺欔橬溄鍊橔䂽傯凹茇欔橬蔙(埇脘閘毖锔誺蕋溄锬釹)诙埡轙亓䫘潙埇傖庘鍴欔橬溄鍊嘖滇認湙儌襕挗償婪麵臘䔇闼湙嘪䫘 CASCADE 㔗
REVOKE 幘埇傖䫌婔婻幽麂赆嘌巉凹茇䔇欔橬蔙準欓臯婉誺認婻蓐謾媙釂滇拖橬臖凹茇䔇蓐謾䔇潊叻潡蔙滇婔婻婘臖凹茇婪毕橬 WITH GRANT OPTION 䔇蓐謾䔇潊叻㔗婘認䓉愙喕婋臖变傴欓臯蕙準儌喘償滇䫌垂鍙拖橬臖凹茇䔇蓐謾潡蔙滇婘臖凹茇婪毕橬 WITH GRANT OPTION 溄鍊䔇蓐謾埏庺䔇婔湙㔗懫套套悩臘 t1 赆 g1 欔橬蔯 u1 滇 u1 䔇潊叻闼幽 u1 埇傖搴體 t1 婪䔇溄鍊蔯亻嘘婺 g1 埏庺䔇变傴㔗認䓉䯄償寙拸 u1 启噽垄 g1 蓐謾潊叻埏庺䔇毽溄㔗
套悩欓臯 REVOKE 䔇蓐謾毕橬溄鍊滇锔誺崔北潊叻噿係诙冖䔇闼幽噙嘷滇巻婻寙劆䔇蓐謾欓臯䔇臖变傴儌滇橻弄滯䔇㔗婘認䓉婺劽婋橔喘䔇桹濘滇嘪䫘 SET ROLE 潊婺嘹婯橕欓臯 REVOKE 䔇蓐謾㔗婉認幽啔䔇劯悩埇脘凚躘役鍴嘹婉愿役鍴䔇溄鍊潡蔙滇嘖溄鍊鄘澇橬役鍴㔗
搴體噸嚖婘臘 films 婪䔇某噖溄鍊
REVOKE INSERT ON films FROM PUBLIC;
搴體䫘潙 manuel 凹蓖商 kinds 䔇欔橬溄鍊
REVOKE ALL PRIVILEGES ON kinds FROM manuel;
臙濘懟認湙垂鍙婪懟叿五"搴體欔橬潏蕋庽䔇溄鍊"㔗
役鍴䫘潙 joe 䔇 admins 潊叻噿係
REVOKE admins FROM joe;
GRANT 变傴䔇噚垹攓媇敇嘺橸婪幘锗䫘庯 REVOKE 㔗臺濘楗襕滇
REVOKE [ GRANT OPTION FOR ] privileges ON object [ ( column [, ...] ) ] FROM { PUBLIC | username [, ...] } { RESTRICT | CASCADE }
湺庖襕挗 RESTRICT 潡 CASCADE 幋婔媙釂庺䯄嘖滇 PostgreSQL 啺螆䚺䩕滇 RESTRICT 㔗