You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/current/_includes/v25.2/sql/privileges.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@ Privilege | Levels | Description
2
2
----------|--------|------------
3
3
`ALL` | System, Database, Schema, Table, Sequence, Type | For the object to which `ALL` is applied, grants all privileges at the system, database, schema, table, sequence, or type level.
4
4
`BACKUP` | System, Database, Table | Grants the ability to create [backups]({% link {{ page.version.version }}/backup-and-restore-overview.md %}) at the system, database, or table level.
5
+
`BYPASSRLS` | [XXX](XXX): XXX (NEW IN v25.2) Grants the ability to bypass [row-level security (RLS)]({% link {{ page.version.version }}/row-level-security.md %}) policies on a table, granting unrestricted read and write access to all rows.
5
6
`CANCELQUERY` | System | Grants the ability to cancel queries.
6
7
`CHANGEFEED` | Table | Grants the ability to create [changefeeds]({% link {{ page.version.version }}/change-data-capture-overview.md %}) on a table.
7
8
<aid="connect"></a>`CONNECT` | Database | Grants the ability to view a database's metadata, which consists of objects in a database's `information_schema` and `pg_catalog` system catalogs. This allows the role to view the database's table, schemas, user-defined types, and list the database when running `SHOW DATABASES`. The `CONNECT` privilege is also required to run backups of the database.
Copy file name to clipboardExpand all lines: src/current/_includes/v25.2/sql/role-options.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
Role option | Description
2
2
------------|-------------
3
+
`BYPASSRLS`/`NOBYPASSRLS` | **New in v25.2**[XXX](XXX):Grants the ability to bypass [row-level security (RLS)]({% link {{ page.version.version }}/row-level-security.md %}) policies on a table, granting unrestricted read and write access to all rows.
3
4
`CANCELQUERY`/`NOCANCELQUERY` | **Deprecated in v22.2: Use the `CANCELQUERY`[system privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#supported-privileges).** Allow or disallow a role to cancel [queries]({% link {{ page.version.version }}/cancel-query.md %}) and [sessions]({% link {{ page.version.version }}/cancel-session.md %}) of other roles. Without this role option, roles can only cancel their own queries and sessions. Even with the `CANCELQUERY` role option, non-`admin` roles cannot cancel `admin` queries or sessions. This option should usually be combined with `VIEWACTIVITY` so that the role can view other roles' query and session information. <br><br>By default, the role option is set to `NOCANCELQUERY` for all non-`admin` roles.
4
5
`CONTROLCHANGEFEED`/`NOCONTROLCHANGEFEED` | **Deprecated in v23.1: Use the `CHANGEFEED`[privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#supported-privileges).** Allow or disallow a role to run [`CREATE CHANGEFEED`]({% link {{ page.version.version }}/create-changefeed.md %}) on tables they have `SELECT` privileges on. <br><br>By default, the role option is set to `NOCONTROLCHANGEFEED` for all non-`admin` roles.
5
6
`CONTROLJOB`/`NOCONTROLJOB` | Allow or disallow a role to [pause]({% link {{ page.version.version }}/pause-job.md %}), [resume]({% link {{ page.version.version }}/resume-job.md %}), and [cancel]({% link {{ page.version.version }}/cancel-job.md %}) jobs. Non-`admin` roles cannot control jobs created by `admin` roles. <br><br>By default, the role option is set to `NOCONTROLJOB` for all non-`admin` roles.
Copy file name to clipboardExpand all lines: src/current/v25.2/alter-role.md
+40-22Lines changed: 40 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,12 @@ The following statements are run by the `root` user that is a member of the `adm
50
50
The following example allows a role to log in to the database with a [password]({% link {{ page.version.version }}/authentication.md %}#client-authentication):
51
51
52
52
~~~sql
53
-
root@:26257/defaultdb> ALTER ROLE carl WITH LOGIN PASSWORD 'An0ther$tr0nGpassW0rD' VALID UNTIL '2021-10-10';
53
+
CREATE ROLE carl;
54
+
~~~
55
+
56
+
~~~sql
57
+
-- sqlchecker: ignore
58
+
ALTER ROLE carl WITH LOGIN PASSWORD 'An0ther$tr0nGpassW0rD' VALID UNTIL '2021-10-10';
54
59
~~~
55
60
56
61
### Prevent a role from using password authentication
@@ -59,73 +64,77 @@ The following statement prevents the user from using password authentication and
59
64
60
65
{% include_cached copy-clipboard.html %}
61
66
~~~sql
62
-
root@:26257/defaultdb>ALTER ROLE carl WITH PASSWORD NULL;
67
+
ALTER ROLE carl WITH PASSWORD NULL;
63
68
~~~
64
69
65
70
### Allow a role to create other roles and manage authentication methods for the new roles
66
71
67
72
The following example allows the role to [create other roles]({% link {{ page.version.version }}/create-role.md %}) and [manage authentication methods]({% link {{ page.version.version }}/authentication.md %}#client-authentication) for them:
68
73
69
74
~~~sql
70
-
root@:26257/defaultdb>ALTER ROLE carl WITH CREATEROLE CREATELOGIN;
75
+
ALTER ROLE carl WITH CREATEROLE CREATELOGIN;
71
76
~~~
72
77
73
78
### Allow a role to create and rename databases
74
79
75
80
The following example allows the role to [create]({% link {{ page.version.version }}/create-database.md %}) or [rename]({% link {{ page.version.version }}/alter-database.md %}#rename-to) databases:
76
81
77
82
~~~sql
78
-
root@:26257/defaultdb>ALTER ROLE carl WITH CREATEDB;
83
+
ALTER ROLE carl WITH CREATEDB;
79
84
~~~
80
85
81
86
### Allow a role to pause, resume, and cancel non-admin jobs
82
87
83
88
The following example allows the role to [pause]({% link {{ page.version.version }}/pause-job.md %}), [resume]({% link {{ page.version.version }}/resume-job.md %}), and [cancel]({% link {{ page.version.version }}/cancel-job.md %}) jobs:
84
89
85
90
~~~sql
86
-
root@:26257/defaultdb>ALTER ROLE carl WITH CONTROLJOB;
91
+
ALTER ROLE carl WITH CONTROLJOB;
87
92
~~~
88
93
89
94
### Allow a role to see and cancel non-admin queries and sessions
90
95
91
96
The following example allows the role to cancel [queries]({% link {{ page.version.version }}/cancel-query.md %}) and [sessions]({% link {{ page.version.version }}/cancel-session.md %}) for other non-`admin` roles:
92
97
93
98
~~~sql
94
-
root@:26257/defaultdb>ALTER ROLE carl WITH CANCELQUERY VIEWACTIVITY;
99
+
ALTER ROLE carl WITH CANCELQUERY VIEWACTIVITY;
95
100
~~~
96
101
97
102
### Allow a role to control changefeeds
98
103
99
104
The following example allows the role to run [`CREATE CHANGEFEED`]({% link {{ page.version.version }}/create-changefeed.md %}):
100
105
101
106
~~~sql
102
-
root@:26257/defaultdb>ALTER ROLE carl WITH CONTROLCHANGEFEED;
107
+
ALTER ROLE carl WITH CONTROLCHANGEFEED;
103
108
~~~
104
109
105
110
### Allow a role to modify cluster settings
106
111
107
112
The following example allows the role to modify [cluster settings]({% link {{ page.version.version }}/cluster-settings.md %}):
108
113
109
114
~~~sql
110
-
root@:26257/defaultdb>ALTER ROLE carl WITH MODIFYCLUSTERSETTING;
115
+
ALTER ROLE carl WITH MODIFYCLUSTERSETTING;
111
116
~~~
112
117
118
+
### Allow a role to bypass row-level security (RLS)
119
+
120
+
[XXX](XXX): XXX
121
+
113
122
### Set default session variable values for a role
114
123
115
124
In the following example, the `root` user creates a role named `max`, and sets the default value of the `timezone`[session variable]({% link {{ page.version.version }}/set-vars.md %}#supported-variables) for the `max` role.
116
125
117
126
~~~sql
118
-
root@:26257/defaultdb>CREATE ROLE max WITH LOGIN;
127
+
CREATE ROLE max WITH LOGIN;
119
128
~~~
120
129
121
130
~~~sql
122
-
root@:26257/defaultdb>ALTER ROLE max SET timezone ='America/New_York';
131
+
ALTER ROLE max SET timezone ='America/New_York';
123
132
~~~
124
133
125
134
This statement does not affect the default `timezone` value for any role other than `max`:
126
135
127
136
~~~sql
128
-
root@:26257/defaultdb>SHOW timezone;
137
+
SHOW timezone;
129
138
~~~
130
139
131
140
~~~
@@ -138,7 +147,7 @@ root@:26257/defaultdb> SHOW timezone;
138
147
To see the default `timezone` value for the `max` role, run the `SHOW` statement as a member of the `max` role:
139
148
140
149
~~~sql
141
-
max@:26257/defaultdb>SHOW timezone;
150
+
SHOW timezone;
142
151
~~~
143
152
144
153
~~~
@@ -155,21 +164,21 @@ max@:26257/defaultdb> SHOW timezone;
155
164
In the following example, the `root` user creates a role named `max` and a database named `movr`, and sets the default value of the `statement_timeout`[session variable]({% link {{ page.version.version }}/set-vars.md %}#supported-variables) for the `max` role in the `movr` database.
156
165
157
166
~~~sql
158
-
root@:26257/defaultdb>CREATE DATABASE movr;
167
+
CREATEDATABASEIF NOT EXISTS movr;
159
168
~~~
160
169
161
170
~~~sql
162
-
root@:26257/defaultdb>CREATE ROLE max WITH LOGIN;
171
+
CREATE ROLE IF NOT EXISTS max WITH LOGIN;
163
172
~~~
164
173
165
174
~~~sql
166
-
root@:26257/defaultdb>ALTER ROLE max IN DATABASE movr SET statement_timeout ='10s';
175
+
ALTER ROLE max IN DATABASE movr SET statement_timeout ='10s';
167
176
~~~
168
177
169
178
This statement does not affect the default `statement_timeout` value for any role other than `max`, or in any database other than `movr`.
@@ -203,11 +212,11 @@ max@:26257/movr> SHOW statement_timeout;
203
212
In the following example, the `root` user creates a database named `movr`, and sets the default value of the `timezone`[session variable]({% link {{ page.version.version }}/set-vars.md %}#supported-variables) for all roles in that database.
204
213
205
214
~~~sql
206
-
root@:26257/defaultdb>CREATE DATABASE movr;
215
+
CREATEDATABASEIF NOT EXISTS movr;
207
216
~~~
208
217
209
218
~~~sql
210
-
root@:26257/defaultdb>ALTER ROLE ALL IN DATABASE movr SET timezone ='America/New_York';
219
+
ALTER ROLE ALL IN DATABASE movr SET timezone ='America/New_York';
211
220
~~~
212
221
213
222
{{site.data.alerts.callout_info}}
@@ -217,7 +226,7 @@ This statement is identical to [`ALTER DATABASE movr SET timezone = 'America/New
217
226
This statement does not affect the default `timezone` value for any database other than `movr`:
218
227
219
228
~~~sql
220
-
root@:26257/defaultdb>SHOW timezone;
229
+
SHOW timezone;
221
230
~~~
222
231
223
232
~~~
@@ -230,7 +239,7 @@ root@:26257/defaultdb> SHOW timezone;
230
239
To see the default `timezone` value for the `max` role, run the `SHOW` statement as a member of the `max` role:
231
240
232
241
~~~sql
233
-
root@:26257/movr>SHOW timezone;
242
+
SHOW timezone;
234
243
~~~
235
244
236
245
~~~
@@ -265,7 +274,7 @@ ALTER ROLE
265
274
266
275
{% include_cached copy-clipboard.html %}
267
276
~~~sql
268
-
ALTER ROLE maxroach WITH SUBJECT 'CN=myName2,OU=myOrgUnit2,O=myOrg2,L=myLocality2,ST=myState2,C=myCountry2' LOGIN;
277
+
ALTER ROLE max WITH SUBJECT 'CN=myName2,OU=myOrgUnit2,O=myOrg2,L=myLocality2,ST=myState2,C=myCountry2' LOGIN;
269
278
~~~
270
279
271
280
{% include {{page.version.version}}/misc/cert-auth-using-x509-subject.md %}
@@ -280,3 +289,12 @@ ALTER ROLE maxroach WITH SUBJECT 'CN=myName2,OU=myOrgUnit2,O=myOrg2,L=myLocality
280
289
-[SQL Statements]({% link {{ page.version.version }}/sql-statements.md %})
281
290
-[Authorization Best Practices]({% link {{ page.version.version }}/security-reference/authorization.md %}#authorization-best-practices)
282
291
-[`SHOW DEFAULT SESSION VARIABLES FOR ROLE`]({% link {{ page.version.version }}/show-default-session-variables-for-role.md %})
[`RENAME TO`](#rename-to) | Change the names of tables. | No
61
61
[`RESET {storage parameter}`](#reset-storage-parameter) | Reset a storage parameter on a table to its default value. | Yes
62
+
[`{ENABLE, DISABLE} ROW LEVEL SECURITY`](#enable-disable-row-level-security) | [XXX](XXX): XXX | No
63
+
[`{FORCE, UNFORCE} ROW LEVEL SECURITY`](#force-unforce-row-level-security) | [XXX](XXX): XXX | No
62
64
[`SET {storage parameter}`](#set-storage-parameter) | Set a storage parameter on a table. | Yes
63
65
[`SET LOCALITY`](#set-locality) | Set the table locality for a table in a [multi-region database]({% link {{ page.version.version }}/multiregion-overview.md %}). | No
64
66
[`SET SCHEMA`](#set-schema) | Change the [schema]({% link {{ page.version.version }}/sql-name-resolution.md %}) of a table. | No
@@ -468,6 +470,34 @@ Parameter | Description |
468
470
469
471
For usage, see [Synopsis](#synopsis).
470
472
473
+
### `{ENABLE, DISABLE} ROW LEVEL SECURITY`
474
+
475
+
[XXX](XXX): XXX
476
+
477
+
#### Required privileges
478
+
479
+
[XXX](XXX): GET THIS REVIEWED
480
+
481
+
The user must be a member of the [`admin`]({% link {{ page.version.version }}/security-reference/authorization.md %}#roles) or [owner]({% link {{ page.version.version }}/security-reference/authorization.md %}#object-ownership) roles, or have the [`BYPASSRLS` privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#supported-privileges) on the table.
482
+
483
+
#### Parameters
484
+
485
+
[XXX](XXX): XXX
486
+
487
+
### `{FORCE, UNFORCE} ROW LEVEL SECURITY`
488
+
489
+
[XXX](XXX): XXX
490
+
491
+
#### Required privileges
492
+
493
+
[XXX](XXX): GET THIS REVIEWED
494
+
495
+
The user must be a member of the [`admin`]({% link {{ page.version.version }}/security-reference/authorization.md %}#roles) or [owner]({% link {{ page.version.version }}/security-reference/authorization.md %}#object-ownership) roles, or have the [`BYPASSRLS` privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#supported-privileges) on the table.
496
+
497
+
#### Parameters
498
+
499
+
[XXX](XXX): XXX
500
+
471
501
### `SET {storage parameter}`
472
502
473
503
`ALTER TABLE ... SET {storage parameter}` sets a storage parameter on an existing table.
0 commit comments