YMatrix
Quick Start
Simulate Time Series Scenarios
Standard Cluster Deployment
Data Modeling
Connecting to The database
Data Writing
Data Migration
Data Query
Maintenance and Monitoring
Performance Tuning
Troubleshooting
Reference Guide
Tool Guide
Data Type
Storage Engine
Execution Engine
Configuration Parameters
SQL Reference
FAQ
Change the definition of an external table.
ALTER EXTERNAL TABLE name action [, ... ]
Among them, action is:
ADD [COLUMN] new_column type
DROP [COLUMN] column [RESTRICT|CASCADE]
ALTER [COLUMN] column TYPE type
OWNER TO new_owner
ALTER EXTERNAL TABLE Changes the definition of an existing external table. The following are the actions supported by ALTER EXTERNAL TABLE.
These operations can be implemented in an external table using ALTER TABLE.
You must use ALTER EXTERNAL TABLE or ALTER TABLE when the owner of the external table is. To change the schema of an external table, you must also have CREATE permissions on the new schema. To change the owner, the user must also be a direct or indirect member of the newly owned role, which must have CREATE privileges for the schema of the external table. Superusers automatically have these permissions.
Modifying the definition of an external table with ALTER EXTERNAL TABLE or ALTER TABLE will not affect external data.
The ALTER EXTERNAL TABLE and ALTER TABLE commands do not modify the type of external table (read, write, web page), the FORMAT information of the table, or the location of external data. To modify this information, you must delete and rebuild the definition of the external table.
name
column
new_column
type
new_owner
CASCADE
RESTRICT
Add a new column to the definition of the external table:
ALTER EXTERNAL TABLE ext_expenses ADD COLUMN manager text;
Change the owner of the external table:
ALTER EXTERNAL TABLE ext_data OWNER TO jojo;
Change the data type of the external table:
ALTER EXTERNAL TABLE ext_leads ALTER COLUMN acct_code TYPE integer;
ALTER EXTERNAL TABLE is an extension of YMatrix SQL. There is no ALTER EXTERNAL TABLE statement in standard SQL statements or PostgreSQL.