16.3. Creating a Postgres Pro View From an Analytical Table #
Important
Postgres Pro views can be recreated only during periods of zero user activity to prevent potential data loss.
Execute the following query:
SELECT metastore.create_view('table_name', 'Postgres_Pro_schema_name');
Where:
table_name: The name of the analytical table from which the Postgres Pro view is created.Postgres_Pro_schema_name: The name of the Postgres Pro schema associated with the view.Optional parameter. If you do not specify it, the schema is selected automatically.
Example 16.4.
SELECT metastore.create_view('table_example');
Once the query is executed, pgpro_metastore performs the following actions:
Verifies user privileges.
Receives metadata of the analytical table and the path to the shared directory.
Generates the
CREATE VIEWquery with the data source being the result of calling theread_parquet()function.Executes the
CREATE VIEWquery.Grants privileges to the Postgres Pro view.
Creates a new entry in the
pga_snapshotmetadata table.