July 15th, 2009

Data Control Language, ALL PRIVILEGES

Posted by admin in R. Data Control Language
Format:   GRANT ALL PRIVILEGES
             ON table_name
             TO {user_id | PUBLIC} [WITH GRANT OPTIONS];

ALL PRIVILEGES is used to give all privileges the grantor has to grant to another user.
Generally this is not a good idea, because you may presume that a user has certain rights when they don’t.

July 13th, 2009

Data Control Language, WITH GRANT OPTIONS

Posted by admin in R. Data Control Language
Format:   GRANT {SELECT | INSERT | UPDATE | DELETE} [column_names]
             ON table_name
             TO {user_id | PUBLIC} [WITH GRANT OPTIONS];

Let us restate: When you create a database object, you own it and you are the only person who can grant privileges to others. When you grant privileges to them, they can use those privileges, but they can not grant those privileges to others. This allows you to give users access to objects, but they can not give access to others.

If you wish to relinquish this control, you can add WITH GRANT OPTIONS when you grant privileges to others. Now it is like they also own the database object and they can grant privileges to as many people as they wish.

July 10th, 2009

Data Control Language, TO PUBLIC

Posted by admin in R. Data Control Language
Format:   GRANT {SELECT | INSERT | UPDATE | DELETE} [column_names]
             ON {table_name | view_name}
             TO {user_id | PUBLIC} [WITH GRANT OPTIONS];

When you GRANT privileges TO PUBLIC, it means that you are giving privileges on this table to all current and future users who can access the database or schema. Obviously you should only use this privilege with extreme care and some installations never use this option.

« Previous PageNext Page »