POST_START
Controlling Table Data Changes with MODIFY Privileges
I recently had the task of managing access to a table in our data warehouse called training.sales.customers. The goal was to ensure that only specific teams could modify the data, while others could only read it. I learned that using the MODIFY privilege is essential for allowing controlled updates to table data.
Granting MODIFY Privileges
I started by granting the MODIFY privilege to the data_engineers group so they could make changes to the customers table. This privilege allows users to update, insert, and delete rows from the table, which is necessary for data engineering workflows.
GRANT MODIFY ON TABLE training.sales.customers TO `data_engineers`;
Grant applied successfully; the principal now has the requested privilege.
I noticed that the system confirmed the privilege was granted successfully. This meant that the data_engineers group now had the ability to modify the table data, which was exactly what I needed for the team to perform their tasks.
Verifying Privileges with SHOW GRANTS
To ensure that the privileges were applied correctly, I ran the SHOW GRANTS command on the customers table. This helped me confirm which users or groups had which privileges, and it was a good way to double-check my work.
SHOW GRANTS ON TABLE training.sales.customers;
| principal | actionType | objectType |
|---|---|---|
| data_analysts | SELECT | TABLE |
| data_engineers | MODIFY | TABLE |
I verified that the data_engineers group had the MODIFY privilege and that the data_analysts group still only had the SELECT privilege. This confirmed that the access control was working as intended.
Revoking MODIFY Privileges
Later, I needed to revoke the MODIFY privilege from the data_engineers group for security reasons. This is an important step to ensure that users don’t have unnecessary permissions, which can lead to data integrity issues or accidental modifications.
REVOKE MODIFY ON TABLE training.sales.customers FROM `data_engineers`;
Revoke applied successfully; the requested privilege is no longer granted.
I noticed that the system confirmed the privilege was revoked successfully. This meant that the data_engineers group no longer had the ability to modify the table data. It was a good reminder of how important it is to regularly review and adjust access controls in a production environment.
Through this process, I learned how to use the MODIFY privilege to control who can make changes to a table, and how to use SHOW GRANTS and REVOKE to manage those permissions effectively. This is a key part of maintaining data security and integrity in a collaborative data environment.


Leave a Reply