17.1. Creating a Column #

Execute the following query:

  SELECT metastore.add_column('schema_name.table_name' or 'table_name', 'column_name', 'data_type');

Where:

  • schema_name: The name of the analytical schema where the table is created.

    Optional parameter. If you do not specify it, the current schema is used.

  • table_name: The name of the analytical table where the column is created.

  • column_name: The unique column name.

  • data_type: The data type of the column.

    For more information about supported data types, refer to Section G.3.

Example 17.1. 

  SELECT metastore.add_column('testtable', 'third_col', 'uint8');

Once the query is executed, pgpro_metastore performs the following actions:

  • Verifies user privileges.

  • Creates a new entry in the pga_column metadata table.

  • Updates the view_sql value for the analytical table.