PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔䆹5. 昄扞垔幬媆誕嬉誕

5.6. 溄鍊

套悩嘹录傺庖婔婻昄扞康凹茇闼幽嘹儌潊婺垄䔇欔橬蔙㔗䚺䩕施埻橬凹茇䔇欔橬蔙埇傖婘凹茇婪啔傂嘘庋愙㔗婺庖噕螩噽垄䫘潙嘪䫘垄潏傸媙釂蕋庽傡傸溄鍊㔗婉誺轙亓䫘潙攂滇埇傖淉嘩傂嘘凹茇㔗

橬喘崔䓉婉劯䔇溄鍊SELECT, INSERT, UPDATE, DELETE, REFERENCES, TRIGGER, CREATE, CONNECT, TEMPORARY, EXECUTE, USAGE 㔗锗䫘庯䬹垔凹茇䔇溄鍊啹凹茇䌂傋(臘/庘昄京)婉劯蔯婉劯㔗橬噿 PostgreSQL 欔櫇毕䔇婉劯䌂傋䔇溄鍊䔇垯昘媇敇臙埗蔄 GRANT 䔇欋喯釕㔗婋麵䔇䆹誗儖婺嘹匘䴺套嘘彷䫘認底溄鍊㔗

媞櫹潡蔙役鍴婔婻凹茇䔇溄鍊愩誩滇欔橬蔙䋸橬䔇溄鍊㔗

㔊濘懟㔏襕櫹埻婔婻臘㔕䘵嚘㔕废彖㔕潡蔙蓖商䔇欔橬蔙嘪䫘 ALTER TABLE 变傴傖埪凹庫噽垄凹茇䌂傋䔇 ALTER 变傴㔗

嘪䫘 GRANT 变傴蕋庽溄鍊㔗啹溴套悩 joe 滇婔婻噾䂟庻婘䔇䫘潙蔯 accounts 滇婔婻噾䂟庻婘䔇臘敘桄臘䔇溄鍊埇傖䫘婋麵䔇变傴蕋庽

GRANT UPDATE ON accounts TO joe;

婘溄鍊䔇嘉䘞喍婪 ALL 彍蕋庽欔橬婯臖凹茇䌂傋䕩噿䔇溄鍊㔗

劉婺 PUBLIC 䔇䬹枪"䫘潙"埇傖䫘庯儖溄鍊蕋庽係䂘婺䔇欔橬䫘潙㔗埥崡誻埇傖嘪䫘"䂇"蓐謾準婞媷䞇䊖婔䆴䫘潙䔇溄鍊䂖誗埇埗蓕䆹18

埇傖嘪䫘 REVOKE 变傴搴體溄鍊

REVOKE ALL ON accounts FROM PUBLIC;

凹茇欔橬蔙䔇䬹枪溄鍊(幘儌滇 DROP, GRANT, REVOKE 京溄鍊)攂滇锊劆婄匂庯欔橬蔙幽婫婉脘蕋庽潡蔙搴體㔗嘖滇凹茇欔橬蔙埇傖锬拷搴體躻噌䔇捞锔溄鍊懫套檪婔婻臘啔潊凹躻噌启彆庺鄘滇埻臂䔇㔗

橔彺埻橬凹茇欔橬蔙(潡蔙轙亓䫘潙)埇傖蕋庽潡蔙搴體凹茇䔇溄鍊㔗嘖滇潏傸埇傖蕋庽婔婻"with grant option"溄鍊認湙儌噕螩毖埖溄鍊䔇庺儖臖溄鍊蘸毽傡庺㔗套悩毽溄锬釹劯準赆搴體闼幽欔橬闼底傯認婻毖埖蔙毖埖庖溄鍊䔇䫘潙(䕘毖潡閘亓)鄘儖崌寂臖溄鍊㔗䂖誗臥蓕 GRANTREVOKE 欋喯釕㔗


劯锔饡釕嬉誕
媞櫹臘婪婔亓昇嚟