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, perform the following steps on the server:
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.shRun 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.confand updates the package index.Install the Postgres Pro AXE DBMS and the pgpro_axe extension.
For example:
sudo apt install dbms-axe-17 pgpro-axe
Add the pgpro_axe extension to the
shared_preload_librariesconfiguration parameter:ALTER SYSTEM SET shared_preload_libraries = pgpro_axe;
When updating the
shared_preload_librariesconfiguration parameter, addpgpro_axeto the existing list of the preloaded libraries rather than replacing it. Otherwise, the other preloaded libraries will no longer be loaded.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_transactionsconfiguration 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.4.2.In this chapter, the metadata catalog will be initialized on the local Postgres Pro AXE server. If you initialize the metadata catalog on a remote server, set the
max_prepared_transactionsconfiguration parameter on that server.For the full list of parameters, refer to Appendix C.
Create a database for Postgres Pro AXE or use an existing one.
For example:
CREATE DATABASE axe_db;
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_proxyschemas. TheSCHEMAclause does not control their location.Configure the Postgres Pro AXE administrator.
Superusers can perform all operations. For other roles, the solution provides a dedicated Postgres Pro AXE administrator role that can query analytical tables and execute all SQL commands and stored procedures if the required privileges are assigned to it.
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';Create the metadata catalog secret.
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_catalogschema 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 axe.create_catalog_secret(current_setting('unix_socket_directories'), current_setting('port'), 'postgres', '', '');