5.1. Configuring the pgpro_metastore Catalog #

Metadata tables of pgpro_metastore are stored in the axe_catalog schema, or the so-called pgpro_metastore catalog. This catalog can be created on the pgpro_metastore server or on a separate server.

To configure the pgpro_metastore catalog:

  1. Configure the connection to the pgpro_metastore catalog server:

    SELECT metastore.define_catalog_connection('host', 'port', 'DB_name', 'username', 'password')
    

    Where:

    • host and port: The hostname and port number of the pgpro_metastore catalog server.

    • DB_name: The name of the database where the pgpro_metastore catalog will be created.

    • username and password: The username and password for connecting to the pgpro_metastore catalog server.

    If one of these parameters is missing, for example, when connecting to the pgpro_metastore catalog server without a user password, pass an empty string instead of a value:

    SELECT metastore.define_catalog_connection('host','port','DB_name','','');
    

    For the changes to take effect, reconnect to the pgpro_metastore server (not to the pgpro_metastore catalog server).

    If the connection to the pgpro_metastore catalog server fails, you are automatically reconnected using the last connection parameters:

    Example 5.1. 

    postgres=# SELECT metastore.remove_storage('mt_storage');
    INFO:  Connection failed! Trying to reconnect.
    INFO:  Reconnecting...1
    INFO:  Reconnect successful!
            remove_storage
    -----------------------------------
    Storage was removed successfully.
    (1 row)
    

  2. Create the pgpro_metastore catalog:

    SELECT metastore.init(force_init bool DEFAULT false)
    

    If the pgpro_metastore catalog is already created on the server, you receive a warning:

    postgres=# SELECT metastore.init();
    INFO:  Metastore catalog already initialized on remote server
    INFO:  Run metastore.init(true) to force rewrite catalog on remote server
    init
    ------
    
    (1 row)
    

    In this case, you can recreate the pgpro_metastore catalog by executing the same query with force_init set to true:

      postgres=# SELECT metastore.init(true);
      init
      ------
    
      (1 row)