Chapter 8. Installing Postgres Pro AXE

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

To install Postgres Pro AXE, perform the following steps on the server:

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

      wget --user access_key --password='' -O ./pgpro-repo-add.sh https://repo.postgrespro.ru/axe/axe/keys/pgpro-repo-add.sh
    
  2. Run the repository setup script:

      sudo sh ./pgpro-repo-add.sh
    

    When prompted, enter the access credentials. 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 and the pgpro_axe extension.

    For example:

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

      ALTER SYSTEM SET shared_preload_libraries = pgpro_axe;
    

    When updating the shared_preload_libraries configuration parameter, add pgpro_axe to the existing list of the preloaded libraries rather than replacing it. Otherwise, the other preloaded libraries will no longer be loaded.

  5. Set the remaining configuration parameters.

    Example 8.1. Minimal Postgres Pro AXE Configuration

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

    You must set the max_prepared_transactions configuration parameter to a value greater than 0 on the server with the metadata catalog, because Postgres Pro AXE uses two-phase commit for transactions that modify both heap tables and analytical tables. The same applies to transactions that execute DDL commands on analytical tables, since in this case system tables of Postgres Pro are also modified. For more information, refer to Section 15.7.2.

    For the full list of parameters, refer to Section C.1.

  6. Restart the 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 the pgpro_axe extension.

    For example:

      \connect axe_db
      CREATE EXTENSION pgpro_axe;
    

    Important

    The extension creates its objects in the dedicated axe, duckdb, and _axe_proxy schemas. The SCHEMA clause does not control their location.

  9. Configure the Postgres Pro AXE administrator.

    For example:

      CREATE ROLE axe_admin WITH LOGIN PASSWORD 'password';
      GRANT ALL ON SCHEMA axe TO axe_admin;
      ALTER SYSTEM SET axe.postgres_role TO 'axe_admin';
    

    By default, a superuser is available in the solution DBMS and can perform all operations. Additionally, a dedicated Postgres Pro AXE administrator exists. It can query analytical tables and execute all SQL commands and stored procedures if the required privileges are assigned to it.

    For more information about access management, refer to Chapter 17.

  10. Restart the server.

  11. Create the metadata catalog secret.

    For example:

      SELECT axe.create_catalog_secret(current_setting('unix_socket_directories'), current_setting('port'), 'postgres', '', '');
    

    The metadata catalog is a set of metadata tables that organize the data from Parquet files into 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.

    If you initialize the metadata catalog on a remote server, set the max_prepared_transactions configuration parameter on that server.

For information on how to check that the installation is successful and Postgres Pro AXE works as expected, refer to Chapter 9.

FAQ