Chapter 8. Deploying Postgres Pro AXE

This chapter describes how to deploy Postgres Pro AXE on a single server. For more information about possible deployment scenarios, refer to Chapter 5.

To deploy Postgres Pro AXE:

  1. Download the repository setup script using the credentials received from Postgres Pro:

      wget --user username --ask-password https://repo.postgrespro.ru/axe/axe/keys/pgpro-repo-add.sh
    

    Enter the repository password when prompted.

  2. Run the repository setup script:

      sudo sh pgpro-repo-add.sh
    

    The repository setup script saves the repository credentials to /etc/apt/auth.conf.d/repo.postgrespro.ru.conf and updates the package index.

  3. Install the Postgres Pro AXE DBMS, pgpro_axe, and pgpro_metastore.

    For example:

      sudo apt install dbms-axe-17 pgpro-axe pgpro-metastore
    
  4. Add pgpro_axe and pgpro_metastore to the shared_preload_libraries configuration parameter:

      ALTER SYSTEM SET shared_preload_libraries = pgpro_axe, pgpro_metastore;
    

    Important

    You must always add extensions in this order.

  5. Set the remaining configuration parameters.

    Example 8.1. Minimal Postgres Pro AXE Configuration

      ALTER SYSTEM SET duckdb.max_memory TO '16GB';
      ALTER SYSTEM SET duckdb.threads TO 2;
      ALTER SYSTEM SET duckdb.unsafe_allow_execution_inside_functions TO 'on';
      ALTER SYSTEM SET duckdb.force_execution TO false;
      ALTER SYSTEM SET duckdb.max_workers_per_postgres_scan TO 2;
      ALTER SYSTEM SET duckdb.threads_for_postgres_scan TO 2;
      ALTER SYSTEM SET duckdb.convert_unsupported_numeric_to_double TO true;
    

    For the full list of parameters, refer to Appendix B.

  6. Restart the Postgres Pro server.

  7. Create a database for Postgres Pro AXE or use an existing one.

    For example:

      CREATE DATABASE axe_db;
    
  8. Connect to the database and create pgpro_axe and pgpro_metastore.

    For example:

      \connect axe_db
      CREATE EXTENSION pgpro_axe;
      CREATE EXTENSION pgpro_metastore;
    

    Important

    You must always create extensions in this order.

  9. Configure the Postgres Pro AXE administrator.

    The Postgres Pro AXE administrator has privileges on all pgpro_metastore objects and can grant some of these privileges to other roles. You can designate any Postgres Pro role as the Postgres Pro AXE administrator.

    For example:

      CREATE ROLE metastore_admin WITH LOGIN PASSWORD 'password';
      GRANT ALL ON SCHEMA metastore TO metastore_admin;
      ALTER SYSTEM SET duckdb.postgres_role TO 'metastore_admin';
    
  10. Restart the Postgres Pro server.

  11. Configure the metadata catalog.

    The metadata catalog is a set of heap tables that store metadata of analytical tables. The catalog is stored in the axe_catalog schema of the Postgres Pro AXE DBMS and can be initialized on the local Postgres Pro AXE server or on a remote server.

    For example:

      SELECT metastore.define_catalog_connection('localhost', '5432', 'axe_db', 'role_name', 'password') ON CONFLICT DO NOTHING;
      SELECT metastore.init() ON CONFLICT DO NOTHING;
    
  12. Check that Postgres Pro AXE is deployed successfully.