-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathrevoke.html
116 lines (103 loc) · 6.02 KB
/
revoke.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>8.19. REVOKE — Presto 0.159 Documentation</title>
<link rel="stylesheet" href="../_static/presto.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.159',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="top" title="Presto 0.159 Documentation" href="../index.html" />
<link rel="up" title="8. SQL Statement Syntax" href="../sql.html" />
<link rel="next" title="8.20. ROLLBACK" href="rollback.html" />
<link rel="prev" title="8.18. RESET SESSION" href="reset-session.html" />
</head>
<body role="document">
<div class="header">
<h1 class="heading"><a href="../index.html">
<span>Presto 0.159 Documentation</span></a></h1>
<h2 class="heading"><span>8.19. REVOKE</span></h2>
</div>
<div class="topnav">
<p class="nav">
<span class="left">
« <a href="reset-session.html">8.18. RESET SESSION</a>
</span>
<span class="right">
<a href="rollback.html">8.20. ROLLBACK</a> »
</span>
</p>
</div>
<div class="content">
<div class="section" id="revoke">
<h1>8.19. REVOKE</h1>
<div class="section" id="synopsis">
<h2>Synopsis</h2>
<div class="highlight-none"><div class="highlight"><pre><span></span>REVOKE [ GRANT OPTION FOR ]
( privilege [, ...] | ALL PRIVILEGES )
ON [ TABLE ] table_name FROM ( grantee | PUBLIC )
</pre></div>
</div>
<p>Usage of the term <code class="docutils literal"><span class="pre">grantee</span></code> denotes both users and roles.</p>
</div>
<div class="section" id="description">
<h2>Description</h2>
<p>Revokes the specified privileges from the specified grantee.</p>
<p>Specifying <code class="docutils literal"><span class="pre">ALL</span> <span class="pre">PRIVILEGES</span></code> revokes <a class="reference internal" href="delete.html"><span class="doc">DELETE</span></a>, <a class="reference internal" href="insert.html"><span class="doc">INSERT</span></a> and <a class="reference internal" href="select.html"><span class="doc">SELECT</span></a> privileges.</p>
<p>Specifying <code class="docutils literal"><span class="pre">PUBLIC</span></code> revokes privileges from all grantees.</p>
<p>The optional <code class="docutils literal"><span class="pre">GRANT</span> <span class="pre">OPTION</span> <span class="pre">FOR</span></code> clause also revokes the privileges to grant the specified privileges.</p>
<p>For <code class="docutils literal"><span class="pre">REVOKE</span></code> statement to succeed, the user executing it should possess the specified privileges as well as the <code class="docutils literal"><span class="pre">GRANT</span> <span class="pre">OPTION</span></code> for those privileges.</p>
</div>
<div class="section" id="examples">
<h2>Examples</h2>
<p>Revoke <code class="docutils literal"><span class="pre">INSERT</span></code> and <code class="docutils literal"><span class="pre">SELECT</span></code> privileges on the table <code class="docutils literal"><span class="pre">orders</span></code> from user <code class="docutils literal"><span class="pre">alice</span></code>:</p>
<div class="highlight-sql"><div class="highlight"><pre><span></span><span class="k">REVOKE</span> <span class="k">INSERT</span><span class="p">,</span> <span class="k">SELECT</span> <span class="k">ON</span> <span class="n">orders</span> <span class="k">FROM</span> <span class="n">alice</span><span class="p">;</span>
</pre></div>
</div>
<p>Revoke <code class="docutils literal"><span class="pre">SELECT</span></code> privilege on the table <code class="docutils literal"><span class="pre">nation</span></code> from everyone, additionally revoking the privilege to grant <code class="docutils literal"><span class="pre">SELECT</span></code> privilege:</p>
<div class="highlight-sql"><div class="highlight"><pre><span></span><span class="k">REVOKE</span> <span class="k">GRANT</span> <span class="k">OPTION</span> <span class="k">FOR</span> <span class="k">SELECT</span> <span class="k">ON</span> <span class="n">nation</span> <span class="k">FROM</span> <span class="k">PUBLIC</span><span class="p">;</span>
</pre></div>
</div>
<p>Revoke all privileges on the table <code class="docutils literal"><span class="pre">test</span></code> from user <code class="docutils literal"><span class="pre">alice</span></code>:</p>
<div class="highlight-sql"><div class="highlight"><pre><span></span><span class="k">REVOKE</span> <span class="k">ALL</span> <span class="k">PRIVILEGES</span> <span class="k">ON</span> <span class="n">test</span> <span class="k">FROM</span> <span class="n">alice</span><span class="p">;</span>
</pre></div>
</div>
</div>
<div class="section" id="limitations">
<h2>Limitations</h2>
<p>Some connectors have no support for <code class="docutils literal"><span class="pre">REVOKE</span></code>.
See connector documentation for more details.</p>
</div>
<div class="section" id="see-also">
<h2>See Also</h2>
<p><a class="reference internal" href="grant.html"><span class="doc">GRANT</span></a></p>
</div>
</div>
</div>
<div class="bottomnav">
<p class="nav">
<span class="left">
« <a href="reset-session.html">8.18. RESET SESSION</a>
</span>
<span class="right">
<a href="rollback.html">8.20. ROLLBACK</a> »
</span>
</p>
</div>
<div class="footer" role="contentinfo">
</div>
</body>
</html>