26.1. Creating a Column (metastore.add_column) #
Required privileges: Postgres Pro AXE administrator only. For more information about stored procedures and privileges, refer to Section 22.1.
Execute the following command:
SELECT metastore.add_column('table_name', 'column_name', 'data_type');
Where:
table_name: The name of the analytical table where the column is created.It can be specified as a fully qualified name in the
schema_name.table_nameformat, or as just the table name. If you do not specify the analytical schema name, the current schema is used.column_name: The unique column name.A column with this name must not exist in the analytical table.
data_type: The data type of the column.For more information about supported data types, refer to Section F.3.
Postgres Pro AXE performs the following actions:
Verifies input parameters and user privileges.
Creates a new entry in the
pga_columnmetadata table.Updates the
view_sqlvalue for the analytical table.
Example 26.1. Executing the metastore.add_column stored procedure
SELECT metastore.add_column('testtable', 'third_col', 'uint8');