ALTER EXTERNAL VIEW - Amazon Redshift
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

ALTER EXTERNAL VIEW

Use the ALTER EXTERNAL VIEW command to update your external view. Depending on which parameters you use, other SQL engines such as Amazon Athena and Amazon EMR Spark that can also reference this view might be affected. For more information about Data Catalog views, see Amazon Glue Data Catalog views.

Syntax

ALTER EXTERNAL VIEW schema_name.view_name {catalog_name.schema_name.view_name | awsdatacatalog.dbname.view_name | external_schema_name.view_name} [FORCE] { AS (query_definition) | REMOVE DEFINITION }

Parameters

schema_name.view_name

The schema that’s attached to your Amazon Glue database, followed by the name of the view.

catalog_name.schema_name.view_name | awsdatacatalog.dbname.view_name | external_schema_name.view_name

The notation of the schema to use when altering the view. You can specify to use the Amazon Glue Data Catalog, a Glue database that you created, or an external schema that you created. See CREATE DATABASE and CREATE EXTERNAL SCHEMA for more information.

FORCE

Whether Amazon Lake Formation should update the definition of the view even if the objects referenced in the table are inconsistent with other SQL engines. If Lake Formation updates the view, the view is considered stale for the other SQL engines until those engines are updated as well.

AS query_definition

The definition of the SQL query that Amazon Redshift runs to alter the view.

REMOVE DEFINITION

Whether to drop and recreate the views. Views must be dropped and recreated to mark them as PROTECTED.

Examples

The following example alters a Data Catalog view named sample_schema.glue_data_catalog_view.

ALTER EXTERNAL VIEW sample_schema.glue_data_catalog_view FORCE REMOVE DEFINITION