3.5. Analytical Schemas #

Analytical schemas are separate namespaces for the metadata of analytical tables. These schemas are similar to Postgres Pro schemas.

The metadata of analytical schemas is stored in the pga_schema metadata table.

3.5.1. Creating an Analytical Schema #

Execute the following query:

  SELECT metastore.add_schema('schema_name');

Where schema_name is the unique analytical schema name.

Example 3.27. 

  SELECT metastore.add_schema('example_schema');

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

  1. Verifies user privileges.

  2. Creates a new analytical schema in the pga_schema metadata table.

3.5.2. Deleting an Analytical Schema #

Important

Analytical schemas associated with analytical tables or Postgres Pro views cannot be deleted.

Execute the following query:

  SELECT metastore.remove_schema('schema_name');

Where schema_name is the name of the analytical schema that will be deleted.

Example 3.28. 

  SELECT metastore.remove_schema('example_schema');

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

  1. Verifies user privileges.

  2. Creates a new snapshot in the pga_snapshot metadata table and specifies for the analytical schema and all its associated pgpro_metastore objects the end_snapshot value in the pga_schema metadata table and other metadata tables.