ALTER VIEW
Warning
SingleStore 9.0 gives you the opportunity to preview, evaluate, and provide feedback on new and upcoming features prior to their general availability. In the interim, SingleStore 8.9 is recommended for production workloads, which can later be upgraded to SingleStore 9.0.
On this page
Atomically replace a view with a new view defined by a SELECT
statement.ALTER VIEW
is an online operation and will not cause concurrently executing queries to fail.
Syntax
ALTER
[DEFINER = { <user> | CURRENT_USER }]
[SCHEMA_BINDING = { ON | OFF }]
VIEW <view_name>
AS <select_statement>
Remarks
-
ALTER VIEW
atomically replaces view<view_
with a new view defined byname> <select_
.statement> -
ALTER VIEW
privileges are granted only to the designer of the view and toSUPER
users.If a SUPER
user alters a view, that user commandeersALTER
privileges from the designer of the view. -
The
DEFINER
clause (ALTER DEFINER = <user>@<host> VIEW <viewname> AS SELECT .
) specifies the user that should be used for security checks when a view is referenced by a query.. . The default value is CURRENT_
.USER -
When
SCHEMA_
is set toBINDING ON
, objects referenced by the view cannot be dropped if the view exists; you need to drop the view before dropping these objects.By default, SCHEMA_
is set toBINDING OFF
. -
The user who runs
ALTER DEFINER.
must have the. VIEW SUPER
permission. -
Refer to the Permission Matrix for the required permission.
Examples
ALTER VIEW view_name AS SELECT * FROM table_name WHERE user_id = "real_person";
Related Topics
Last modified: March 7, 2025