Grant usage in SQL

Source: Internet
Author: User
Grant
Name
Grant-grant access permissions to a user, a group, or all users

Syntax
Grant privilege [,...] on object [,...]
To {public | group | username}
Input
Privilege

Possible permissions include:
Select
Access all columns/fields in the declared table/view.
Insert
Insert all column fields into the declared table.
Update
Update all columns/fields in the declared table.
Delete
Delete all rows from the declared table.
Rule
Define rules on tables/views (see create Rule Statements ).
All
Grant all permissions.
Object

Name of the object to be granted permissions. Possible objects are:
Table
View

Sequence

Public
Represents the abbreviation of all users.
Group
Group to be granted permissions.
Username
The username to be granted. Public is short for all users.

Output
Change
If yes, this message is returned.
Error: changeacl: Class "object" not found
If the declared object is unavailable or it is impossible to grant permissions to the declared group or user.
Description
Grant allows the Object Creator to grant certain permissions to a user or a group or all users (public. after an object is created, no one except the Creator grants the object permission.
Once a user has the permission of an object, he can use the permission. you do not need to grant (grant) the object permissions to the creator. The Creator automatically has all the permissions of the object, including the permission to delete it.

Note:
Currently, to grant only several columns of permissions to ipvs, you must create a view containing those columns and grant the permissions to those views.
Use the Psql/Z command to obtain more information about the existing object permissions:

Database = Lusitania
+ ------------------ + ----------------------------------------------- +
| Relation | grant/revoke permissions |
+ ------------------ + ----------------------------------------------- +
| Mytable | {"= RW", "Miriam = ARWR", "group todos = RW"} |
+ ------------------ + ----------------------------------------------- +
Legend:
Uname = ARWR -- privileges granted to a user
Group gname = ARWR -- privileges granted to a group
= ARWR -- privileges granted to public

R -- select
W -- Update/delete
A -- insert
R -- rule
ARWR -- all
See the revoke statement to revoke access permissions.

Usage
Insert record permissions to table films for all users:
Grant insert on films to public;
Grant all permissions to the Manuel operation view kinds:
Grant all on kinds to Manuel;
Compatibility
Sql92
Sql92 grant syntax allows you to set permissions for a single column/Field in a table, and allow you to set a permission to grant others the same permissions:
Grant privilege [,...]
On object [(column [,...])] [,...]
To {public | username [,...]} [with grant option]
These fields are compatible with ipvs implementation, except for the following exceptions:
Privilege
Sql92 allows declaring additional permissions:
Select
References
Certain or all columns/fields can be used in the integrity constraints of a declared table.
Usage
A domain, Character Set, set, or transaction is allowed. If the declared object is not a table/view, privilege can only be declared as usage.
Object
[Table] Table
Sql92 allows an additional non-functional keyword table.
Character Set
The declared character set is allowed.
Collation
The declared set sequence is allowed.
Translation
The declared Character Set conversion is allowed.
Domain
The declared domain is allowed.
With grant option
Grant the same permissions to others.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.