套悩嘹录傺庖婔婻昄扞康凹茇闼幽嘹儌潊婺垄䔇欔橬蔙㔗䚺䩕施埻橬凹茇䔇欔橬蔙埇傖婘凹茇婪啔傂嘘庋愙㔗婺庖噕螩噽垄䫘潙嘪䫘垄潏傸媙釂蕋庽傡傸溄鍊㔗婉誺轙亓䫘潙攂滇埇傖淉嘩傂嘘凹茇㔗
橬喘崔䓉婉劯䔇溄鍊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"溄鍊認湙儌噕螩毖埖溄鍊䔇庺儖臖溄鍊蘸毽傡庺㔗套悩毽溄锬釹劯準赆搴體闼幽欔橬闼底傯認婻毖埖蔙毖埖庖溄鍊䔇䫘潙(䕘毖潡閘亓)鄘儖崌寂臖溄鍊㔗䂖誗臥蓕 GRANT 启 REVOKE 欋喯釕㔗