37.1. Defining a Metadata Catalog Connection (define_catalog_connection) #

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.define_catalog_connection('host', 'port', 'database', 'username', 'password');

Where:

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

  • database: The name of the database where the metadata catalog is initialized.

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

If one of these parameters is missing, for example, when connecting to the server with the metadata catalog without a user password, pass an empty string as a value.

Example 37.1. 

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

Reconnect to the pgpro_metastore server (not to the server with the metadata catalog) for the changes to take effect.

If the connection to the server with the metadata catalog fails, you are automatically reconnected using the last connection parameters.

Example 37.2. 

      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)