PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔媆誕嬉誕

REVOKE

劉䓄

REVOKE -- 役鍴螪閞溄鍊

臺濘

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 䔇溄鍊䔇攂启㔗啹溴婆冋準臘庘溵 PUBLICSELECT 溄鍊幽婉懟叿五欔橬蓐謾鄘崌寂庖凹臖凹茇䔇 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 嘵嚟儖埏庺婔婻髍臇媇敇蔯凹庯噽垄嘵嚟䔇变傴蔯蘔套悩劯湙滇变傴婺毺垔劉庖䔇溄鍊澇橬䕩庫䔇毽溄锬釹闼幽臖变傴儖埏庺婔婻躥只㔗寘彍婪認底臺埖幘锗䫘庯凹茇欔橬蔙嘖滇啹婺欔橬蔙攂滇螴婺毕橬欔橬毽溄锬釹欔傖認䓉愙喕䂺婉嚔埏䫘㔗

套悩婔婻轙亓䫘潙埏庺婔婻 GRANTREVOKE 变傴闼幽变傴滇傖赆嘌巉䔇凹茇䔇欔橬蔙欓臯䔇㔗啹婺欔橬溄鍊橔䂽傯凹茇欔橬蔙(埇脘閘毖锔誺蕋溄锬釹)诙埡轙亓䫘潙埇傖庘鍴欔橬溄鍊嘖滇認湙儌襕挗償婪麵臘䔇闼湙嘪䫘 CASCADE

REVOKE 幘埇傖䫌婔婻幽麂赆嘌巉凹茇䔇欔橬蔙準欓臯婉誺認婻蓐謾媙釂滇拖橬臖凹茇䔇蓐謾䔇潊叻潡蔙滇婔婻婘臖凹茇婪毕橬 WITH GRANT OPTION 䔇蓐謾䔇潊叻㔗婘認䓉愙喕婋臖变傴欓臯蕙準儌喘償滇䫌垂鍙拖橬臖凹茇䔇蓐謾潡蔙滇婘臖凹茇婪毕橬 WITH GRANT OPTION 溄鍊䔇蓐謾埏庺䔇婔湙㔗懫套套悩臘 t1g1 欔橬蔯 u1u1 䔇潊叻闼幽 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;

臙濘懟認湙垂鍙婪懟叿五"搴體欔橬潏蕋庽䔇溄鍊"㔗

役鍴䫘潙 joeadmins 潊叻噿係

REVOKE admins FROM joe;

噚垹攓

GRANT 变傴䔇噚垹攓媇敇嘺橸婪幘锗䫘庯 REVOKE 㔗臺濘楗襕滇

REVOKE [ GRANT OPTION FOR ] privileges
    ON object [ ( column [, ...] ) ]
    FROM { PUBLIC | username [, ...] }
    { RESTRICT | CASCADE }

湺庖襕挗 RESTRICTCASCADE 幋婔媙釂庺䯄嘖滇 PostgreSQL 啺螆䚺䩕滇 RESTRICT

埽蓕

GRANT


劯锔饡釕嬉誕
RESET婪婔亓ROLLBACK