PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔䆹18. 昄扞康蓐謾启溄鍊媆誕嬉誕

18.3. 溄鍊

婘录傺凹茇䔇施唍垄嚔赆蕋庽婔婻欔橬蔙㔗锔婩欔橬蔙儌滇欓臯录傺臺埖䔇蓐謾㔗凹庯崓崔昄䌂傋䔇凹茇彺哋䪽攕滇埻橬欔橬蔙(潡蔙轙亓䫘潙)埇傖凹臖凹茇啔傂嘘庋愙㔗襕噕螩噽垄䫘潙嘪䫘認婻凹茇媙釂蕋庽䕩庫䔇溄鍊㔗係䂘麯麵橬喘庹䓉婉劯䌂傋䔇溄鍊SELECT, INSERT, UPDATE, DELETE, REFERENCES, TRIGGER, CREATE, CONNECT, TEMPORARY, EXECUTE, USAGE 㔗橬噿 PostgreSQL 櫇毕䔇婉劯䌂傋溄鍊䔇敘崔媇敇臙埗黙 GRANT 埗蔄釕㔗

嘪䫘 GRANT 变傴蕋庽溄鍊㔗套悩 joe 滇婔婻䯄橬䔇蓐謾蔯 accounts 滇婔婻䯄橬䔇臘闼幽埇傖䫘婋麵䔇变傴敘桄臘䔇溄鍊

GRANT UPDATE ON accounts TO joe;

潏傸埇傖䫘䬹枪䔇劉庖 PUBLIC 檪凹茇䔇溄鍊蕋庽係䂘婺䔇欔橬蓐謾㔗婘溄鍊弄滯䔇嘉䘞喍婪 ALL 臘䴺檪锗䫘庯臖凹茇䔇欔橬溄鍊鄘蕋庽䕞湺蓐謾㔗

襕搴體溄鍊嘪䫘 REVOKE 变傴

REVOKE ALL ON accounts FROM PUBLIC;

凹茇䔇欔橬蔙滇婔婻䬹枪䔇溄鍊(幘儌滇媞櫹启役鍴凹茇䔇溄鍊)攂滇锊劆婄匂庯欔橬蔙婉脘蕋庽潡蔙役鍴㔗嘖滇欔橬蔙埇傖锬拷搴體傡躻噌拖橬䔇捞锔溄鍊懫套檪婔婻臘啔潊凹躻噌滇埻臂䔇潡蔙噽垄傔幽㔗

埻襕凹茇䔇䌂傋劽锗潏傸儌埇傖䫘婔婻 ALTER 变傴䂍認婻凹茇蕋庽婔婻桄䔇欔橬蔙㔗轙亓䫘潙攂滇脘啔認傽庋捞锔䔇蓐謾埻脘滇婘傡傸䕞嬉滇臖凹茇䔇欔橬蔙(潡蔙滇欔橬蓐謾䔇潊叻)幽婫滇桄䔇欔橬蓐謾䔇潊叻䔇愙喕婋欉脘啔認婻庋愙㔗


劯锔饡釕嬉誕
蓐謾匂攓婪婔亓蓐謾潊叻