1

I wonder what the result of the following grant/revokes is according to the SQL standard. Suppose A created a table tab and there are four users (i.e., A, B, C and D). The SQL commands are:

grant select on tab to B with grant option;   (by A)
grant select on tab to C with grant option;   (by B)
grant select on tab to B with grant option;   (by C)
grant select on tab to D with grant option;   (by A)
grant select on tab to C with grant option;   (by D)
revoke select on tab from B;                  (by A)

In Posgresql, it complains that it is not allowed to grant a privilege to grantor. In MySQL, it is allowed and the privilege of B is revoked although there is a path system->A->D->C->B in the authorization graph. Therefore, I wonder what the standard say about this situation. Does it define how these commands are handled?

3
  • 2
    what the standard say about this situation. Each DBMS implements its own politics.
    – Akina
    Mar 25 at 17:32
  • You can read the chapter about SQL Authorization here: sql-99.readthedocs.io/en/latest/chapters/15.html. This document summarizes the SQL-99 standard in less formal language. What the standard says about it is academic, and not necessarily applicable to any given implementation of SQL. Every SQL product (you tagged mysql and postgresql) has variation in how they choose to implement it, and they may not conform to the SQL standard perfectly. Mar 25 at 21:26
  • @Akina Still, the standard is relevant. Mar 26 at 7:26

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.