Skip to content

Commit f3193d2

Browse files
Fix ALTER VIEW required privileges for v23.1 through v26.2
The ALTER VIEW pages stated that altering a view requires `CREATE` on the parent database, and that `SET SCHEMA` and `RENAME TO` additionally require `DROP` on the view. Verified against a running v24.3 server: - `SET SCHEMA` requires `DROP` on the view and `CREATE` on the new schema, not `CREATE` on the parent database. - `RENAME TO` requires `DROP` on the view and `CREATE` on the view's database. - The standalone "must have `CREATE` on the parent database" bullet described no single operation on its own, so it is removed. This brings the ALTER VIEW privilege model in line with ALTER TABLE and the corrected ALTER SEQUENCE pages. The v26.3 page documents the schema-scoped rename privilege separately. Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
1 parent c905945 commit f3193d2

11 files changed

Lines changed: 22 additions & 22 deletions

File tree

src/current/v23.1/alter-view.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ The `ALTER VIEW` [statement]({% link {{ page.version.version }}/sql-statements.m
1111

1212
## Required privileges
1313

14-
- To alter a view, the user must have the `CREATE` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the parent database.
15-
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, or to change the name of a view with `ALTER VIEW ... RENAME TO`, the user must also have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view.
14+
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the new schema.
15+
- To rename a view with `ALTER VIEW ... RENAME TO`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the view's database.
1616

1717
## Syntax
1818

src/current/v23.2/alter-view.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ The `ALTER VIEW` [statement]({% link {{ page.version.version }}/sql-statements.m
1111

1212
## Required privileges
1313

14-
- To alter a view, the user must have the `CREATE` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the parent database.
15-
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, or to change the name of a view with `ALTER VIEW ... RENAME TO`, the user must also have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view.
14+
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the new schema.
15+
- To rename a view with `ALTER VIEW ... RENAME TO`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the view's database.
1616

1717
## Syntax
1818

src/current/v24.1/alter-view.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ The `ALTER VIEW` [statement]({% link {{ page.version.version }}/sql-statements.m
1111

1212
## Required privileges
1313

14-
- To alter a view, the user must have the `CREATE` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the parent database.
15-
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, or to change the name of a view with `ALTER VIEW ... RENAME TO`, the user must also have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view.
14+
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the new schema.
15+
- To rename a view with `ALTER VIEW ... RENAME TO`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the view's database.
1616

1717
## Syntax
1818

src/current/v24.2/alter-view.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ The `ALTER VIEW` [statement]({% link {{ page.version.version }}/sql-statements.m
1111

1212
## Required privileges
1313

14-
- To alter a view, the user must have the `CREATE` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the parent database.
15-
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, or to change the name of a view with `ALTER VIEW ... RENAME TO`, the user must also have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view.
14+
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the new schema.
15+
- To rename a view with `ALTER VIEW ... RENAME TO`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the view's database.
1616

1717
## Syntax
1818

src/current/v24.3/alter-view.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ The `ALTER VIEW` [statement]({% link {{ page.version.version }}/sql-statements.m
1111

1212
## Required privileges
1313

14-
- To alter a view, the user must have the `CREATE` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the parent database.
15-
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, or to change the name of a view with `ALTER VIEW ... RENAME TO`, the user must also have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view.
14+
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the new schema.
15+
- To rename a view with `ALTER VIEW ... RENAME TO`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the view's database.
1616

1717
## Syntax
1818

src/current/v25.1/alter-view.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ The `ALTER VIEW` [statement]({% link {{ page.version.version }}/sql-statements.m
1111

1212
## Required privileges
1313

14-
- To alter a view, the user must have the `CREATE` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the parent database.
15-
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, or to change the name of a view with `ALTER VIEW ... RENAME TO`, the user must also have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view.
14+
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the new schema.
15+
- To rename a view with `ALTER VIEW ... RENAME TO`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the view's database.
1616

1717
## Syntax
1818

src/current/v25.2/alter-view.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ The `ALTER VIEW` [statement]({% link {{ page.version.version }}/sql-statements.m
1111

1212
## Required privileges
1313

14-
- To alter a view, the user must have the `CREATE` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the parent database.
15-
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, or to change the name of a view with `ALTER VIEW ... RENAME TO`, the user must also have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view.
14+
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the new schema.
15+
- To rename a view with `ALTER VIEW ... RENAME TO`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the view's database.
1616

1717
## Syntax
1818

src/current/v25.3/alter-view.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ The `ALTER VIEW` [statement]({% link {{ page.version.version }}/sql-statements.m
1111

1212
## Required privileges
1313

14-
- To alter a view, the user must have the `CREATE` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the parent database.
15-
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, or to change the name of a view with `ALTER VIEW ... RENAME TO`, the user must also have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view.
14+
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the new schema.
15+
- To rename a view with `ALTER VIEW ... RENAME TO`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the view's database.
1616

1717
## Syntax
1818

src/current/v25.4/alter-view.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ The `ALTER VIEW` [statement]({% link {{ page.version.version }}/sql-statements.m
1111

1212
## Required privileges
1313

14-
- To alter a view, the user must have the `CREATE` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the parent database.
15-
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, or to change the name of a view with `ALTER VIEW ... RENAME TO`, the user must also have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view.
14+
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the new schema.
15+
- To rename a view with `ALTER VIEW ... RENAME TO`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the view's database.
1616

1717
## Syntax
1818

src/current/v26.1/alter-view.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ The `ALTER VIEW` [statement]({% link {{ page.version.version }}/sql-statements.m
1111

1212
## Required privileges
1313

14-
- To alter a view, the user must have the `CREATE` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the parent database.
15-
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, or to change the name of a view with `ALTER VIEW ... RENAME TO`, the user must also have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view.
14+
- To change the schema of a view with `ALTER VIEW ... SET SCHEMA`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the new schema.
15+
- To rename a view with `ALTER VIEW ... RENAME TO`, the user must have the `DROP` [privilege]({% link {{ page.version.version }}/security-reference/authorization.md %}#managing-privileges) on the view and the `CREATE` privilege on the view's database.
1616

1717
## Syntax
1818

0 commit comments

Comments
 (0)