17.1. Установка Postgres Pro Enterprise #
- 17.1.1. Поддерживаемые дистрибутивы Linux
- 17.1.2. Поддерживаемые дистрибутивы Linux для сертифицированной редакции
- 17.1.3. Подключение репозитория пакетов
- 17.1.4. Добавление публичного ключа в Astra Linux
- 17.1.5. Быстрая установка и настройка
- 17.1.6. Расширенная установка
- 17.1.7. Установка на рабочих станциях разработчиков
- 17.1.8. Настройка нескольких экземпляров Postgres Pro
- 17.1.9. Замечания о совместимости с антивирусами
- 17.1.2. Поддерживаемые дистрибутивы Linux для сертифицированной редакции
Postgres Pro работает только в ОС на базе Linux и поставляется в виде двоичных пакетов. Все двоичные дистрибутивы Postgres Pro состоят из нескольких пакетов. Структура пакетов отличается от структуры ванильного PostgreSQL и поддерживает следующие режимы установки:
Быстрая установка и настройка. Пакет
postgrespro-ent-16устанавливает и настраивает все компоненты, необходимые для получения готовой к использованию конфигурации, как клиентских, так и серверных компонентов. Выберите этот вариант, если вы планируете установить только один экземпляр Postgres Pro и вас не беспокоят возможные конфликты с другими продуктами на базе PostgreSQL.Важно
При установке пакета
postgrespro-ent-16могут быть удалены существующие инсталляции продуктов на базе Postgres Pro и PostgreSQL. И напротив, установленный пакет Postgres Pro может быть автоматически удалён, если вы впоследствии развернёте другой продукт на базе PostgreSQL. Данный пакет не нужно устанавливать в процессе обновления или миграции, а также если вы планируете разворачивать в одной системе несколько инсталляций.Расширенная установка. Вы можете выбрать любые пакеты, требующиеся для ваших целей, включая пакеты для разработчиков. Этот вариант требует ручной настройки, поэтому для него необходимо хорошо разбираться в Linux и понимать архитектуру PostgreSQL. Это единственно возможный вариант, если вы планируете реализовать один из следующих сценариев использования Postgres Pro:
Установка одновременно нескольких версий Postgres Pro либо установка вместе с другими продуктами на базе PostgreSQL.
Обновление с другой версии или миграция с другого продукта на базе PostgreSQL.
Управление сервером Postgres Pro с использованием программных средств обеспечения высокой степени доступности, таких как pacemaker, вместо стандартных системных механизмов управления службами.
Минимальные системные требования для установки Postgres Pro, создания кластера баз данных и запуска сервера:
Процессор с частотой 1 ГГц
1 ГБ ОЗУ
1 ГБ свободного дискового пространства
Для вспомогательных компонентов или данных потребуется дополнительное дисковое пространство.
17.1.1. Поддерживаемые дистрибутивы Linux #
Двоичные пакеты Postgres Pro предоставляются для следующих систем на базе Linux:
Системы Linux для архитектуры x86-64:
Системы Red Hat Enterprise Linux (RHEL) и производные от них: Red Hat Enterprise Linux 8/9/10, Rocky Linux 9/10, Oracle Linux 9/10, AlmaLinux 9/10, РЕД ОС МУРОМ 7.3/8, РОСА «ХРОМ» 2021.1
Системы на базе Debian: Debian 11/12/13, Ubuntu 22.04/24.04, Astra Linux 1.7/1.8
Альт 10/11, Альт СП 8.2, Альт СП релиз 10
SUSE Linux Enterprise Server (SLES) 15
Системы Linux для архитектуры процессоров Эльбрус: Альт 10 для e2kv3/e2kv4, Альт СП 8.2 для e2kv3/e2kv4, Альт СП релиз 10 для e2kv3/e2kv4, Astra Linux «Ленинград» 8.1, ОС «Эльбрус» 3.9
Системы Linux для архитектуры ARM: RHEL 8/9/10, Rocky Linux 9/10, Oracle Linux 9/10, AlmaLinux 9/10, РЕД ОС МУРОМ 7.3/8, Debian 11/12/13, Ubuntu 22.04/24.04, Альт 10/11, Альт СП 8.2, Альт СП релиз 10, Astra Linux «Новороссийск»
Примечание
Двоичные пакеты Postgres Pro используют библиотеку tzdata, предоставляемую операционной системой, поэтому важно, чтобы в системе была установлена последняя её версия. В случае использования устаревшей библиотеки tzdata значения времени в вашей базе данных могут быть некорректными.
17.1.2. Поддерживаемые дистрибутивы Linux для сертифицированной редакции #
Двоичные пакеты Postgres Pro предоставляются для следующих систем на базе Linux:
Системы Linux для архитектуры x86-64:
Astra Linux Special Edition 1.7/1.8
Альт СП 8/8.2/8.4, Альт СП релиз 10
РЕД ОС 7.3/8
РОСА «ХРОМ» 2021.1
Системы Linux для архитектуры процессоров Эльбрус:
Альт СП 8 для e2k/e2kv4
Альт СП релиз 10 для e2k/e2kv4
Astra Linux Special Edition «Ленинград» 8.1 для e2k-8c
Примечание
Двоичные пакеты Postgres Pro используют библиотеку tzdata, предоставляемую операционной системой, поэтому важно, чтобы в системе была установлена последняя её версия. В случае использования устаревшей библиотеки tzdata значения времени в вашей базе данных могут быть некорректными.
17.1.3. Подключение репозитория пакетов #
Важно
Postgres Pro Enterprise Certified нельзя установить или обновить из репозитория пакетов.
В соответствии с правилами ФСТЭК, поставка Postgres Pro Enterprise Certified пользователям осуществляется на USB-флеш-накопителе с ISO-образом оптического диска, в который входят инсталляционные пакеты СУБД и дополнительных расширений, а также комплект эксплуатационной документации и Формуляра с файлами контрольных сумм.
По запросу доступна альтернативная поставка на оптическом диске или через личный кабинет по защищённому каналу. Подробности уточняйте в отделе технической поддержки Postgres Pro Enterprise или в отделе продаж.
Подробности установки сертифицированной версии СУБД приведены в разделе «Установка СУБД» Руководства по комплексу средств защиты информации.
Перед установкой Postgres Pro из двоичных пакетов (с помощью менеджера пакетов вашей операционной системы) необходимо подключить репозиторий пакетов Postgres Pro.
Чтобы получить доступ к репозиторию, вам потребуется действующий сертификат технической поддержки и ключ доступа из личного кабинета на портале технической поддержки.
Для подключения репозитория выполните следующие действия:
Убедитесь, что утилита wget установлена и имеет доступ в Интернет.
Скрипту необходима утилита wget и доступ в Интернет, чтобы проверить корректность реквизитов в ходе подключения репозитория.
Примечание
Для доступа в Интернет невозможно использовать SOCKS5-прокси, поскольку в wget отсутствует поддержка прокси этого типа.
Получите ключ доступа к репозиторию:
Откройте свой личный кабинет на портале технической поддержки и перейдите на страницу → → .
Ключи доступны только администраторам набора лицензий.
Загрузите Bash-скрипт
pgpro-repo-add.sh:wget --user access_key --password='' https://repo.postgrespro.ru/ent/ent-16/keys/pgpro-repo-add.sh
Этот скрипт подключит репозиторий, чтобы менеджер пакетов вашей операционной системы мог использовать его.
(Необязательно) При необходимости проверьте содержимое файла со скриптом.
Запустите скрипт от имени пользователя
root(например, используя sudo).Введите реквизиты для доступа к репозиторию, когда скрипт их запросит.
Важно
Если реквизиты не были предоставлены или они некорректны, скрипт предложит подключить репозиторий без указания реквизитов.
Если вы решите подключить репозиторий без указания реквизитов, то, чтобы получить доступ к репозиторию, вам потребуется указать реквизиты вручную.
Теперь все готово к установке Postgres Pro Enterprise с помощью менеджера пакетов вашей операционной системы.
17.1.4. Добавление публичного ключа в Astra Linux #
Перед установкой Postgres Pro Enterprise в Astra Linux в режиме замкнутой программной среды (ЗПС) необходимо добавить публичный ключ для проверки двоичных пакетов Postgres Pro Enterprise.
Для добавления публичного ключа выполните следующие действия:
Загрузите файл публичного ключа
SSE-ASTRA-GPG-POSTGRESPROдля Astra Linux с репозитория Postgres Pro.Публичный ключ из репозитория имеет формат ASCII. Но для замкнутой программной среды в Astra Linux требуется публичный ключ в двоичном формате.
Преобразуйте ключ из формата ASCII в двоичный формат:
gpg --dearmor --output pgpro-astra.key SSE-ASTRA-GPG-POSTGRESPRO
Скопируйте публичный ключ в двоичном формате в каталог
/etc/digsig/keys/.Убедитесь, что следующие параметры добавлены в конфигурационный файл
/etc/digsig/digsig_initramfs.conf:DIGSIG_ELF_MODE=1 DIGSIG_XATTR_MODE=0 DIGSIG_IGNORE_XATTR_KEYS=0 DIGSIG_IGNORE_GOST2001=0
Обновите initramfs:
sudo update-initramfs -u -k all
Перезагрузите машину.
Приступайте к установке.
17.1.5. Быстрая установка и настройка #
Если вам нужно установить только один экземпляр Postgres Pro и вы не собираетесь использовать никакие другие продукты на базе PostgreSQL в вашей системе, вы можете использовать режим быстрой установки. Типичная процедура установки в этом случае выглядит так:
Подключите репозиторий пакетов, предназначенный для вашей операционной системы.
Установите пакет
postgrespro-ent-16. При этом по зависимостям установятся все требуемые компоненты, будет создана база данных по умолчанию, запущен сервер баз данных и настроен автозапуск сервера при загрузке системы, а все предоставляемые программы станут доступными в путиPATH.
Примечание
По умолчанию конфигурация базы данных настраивается под устанавливаемый продукт Postgres Pro. Если вам нужна другая настройка сервера базы данных, выберите расширенную установку и воспользуйтесь аргументом tune команды pg-setup initdb.
После завершения установки вы можете запустить psql от имени пользователя postgres и подключиться к только что созданной базе данных, находящейся в каталоге данных /var/lib/pgpro/ent-16/data.
Так как база данных по умолчанию создаётся скриптом pg-setup, путь к каталогу данных сохраняется в файле /etc/default/postgrespro-ent-16. Все последующие команды pg-setup, а также любые команды, управляющие службой Postgres Pro, будут нацелены именно на эту базу данных. Кроме того, в указанном файле можно изменить значение PG_OOM_ADJUST_VALUE для дочерних процессов postmaster (за подробностями обратитесь к Подразделу 18.4.4).
17.1.6. Расширенная установка #
Разделение дистрибутива на несколько пакетов позволяет произвести инсталляцию по-разному для различных применений: для серверов баз данных, клиентских систем или рабочих станций разработчиков. Такие инсталляции необходимо настраивать вручную, но это даёт дополнительную гибкость при использовании продукта. Вы можете установить несколько версий Postgres Pro параллельно, а также вместе с другими продуктами PostgreSQL. В частности, это может потребоваться при осуществлении обновления или при миграции с другого продукта на базе PostgreSQL.
Для осуществления расширенной установки выполните следующие действия:
Подключите репозиторий пакетов, предназначенный для вашей операционной системы.
Выберите пакеты Postgres Pro, требующиеся для ваших целей, и установите их с помощью стандартных для вашего дистрибутива Linux команд. Доступные пакеты перечислены в Таблице 17.1.
В результате все файлы будут установлены в каталог
/opt/pgpro/ent-16.Запустите от имени root утилиту pg-wrapper, чтобы добавить и клиентские, и серверные установленные программы в путь поиска
PATH, а также включить страницы man по SQL в файл конфигурации страниц man. Эта утилита входит в состав пакетаpostgrespro-ent-16-client./opt/pgpro/ent-16/bin/pg-wrapper links update
Подробнее о разрешении возможных конфликтов рассказывается в pg-wrapper.
Если вы устанавливаете пакет
postgrespro-ent-16-server, выполните следующую процедуру настройки сервера:Создайте начальную базу данных, запустив вспомогательный скрипт pg-setup от имени root с ключом
initdb:/opt/pgpro/ent-16/bin/pg-setup initdb [
параметры_initdb]Здесь:
Аргумент
tuneвыбирает вариант конфигурации базы данных.параметры_initdb— обычные параметры initdb.
Примечание
По умолчанию pg-setup инициализирует кластер баз данных со включёнными контрольными суммами. Если для вас это нежелательно, укажите
--no-data-checksums.Скрипт
pg-setupвыполняет административные операции с базами данных от имени пользователяpostgres. Если вы не укажете никакие параметры initdb, база по умолчанию создаётся в каталоге/var/lib/pgpro/ent-16/dataс параметрами локализации, определяемыми переменной окруженияLANGтекущего сеанса. Переменные окруженияLC_*при этом игнорируются.Так как база данных по умолчанию создаётся скриптом pg-setup, путь к каталогу данных сохраняется в файле
/etc/default/postgrespro-ent-16. Все последующие команды pg-setup, а также любые команды, управляющие службой Postgres Pro, будут нацелены именно на эту базу данных. Кроме того, в указанном файле можно изменить значениеPG_OOM_ADJUST_VALUEдля дочерних процессов postmaster (за подробностями обратитесь к Подразделу 18.4.4).Запустите сервер с помощью
pg-setupот имени root следующим образом:/opt/pgpro/ent-16/bin/pg-setup service start
Как и сервер ванильного PostgreSQL, сервер Postgres Pro работает под именем пользователя
postgres.Примечание
По умолчанию автоматический запуск сервера отключён, чтобы вы могли вручную управлять восстановлением базы данных после перезагрузки системы. Однако вы можете настроить и автоматический запуск сервера Postgres Pro. За подробностями обратитесь к Подразделу 17.1.6.2.
17.1.6.1. Выбор устанавливаемых пакетов #
В следующей таблице перечислены все имеющиеся пакеты Postgres Pro Enterprise.
Таблица 17.1. Пакеты Postgres Pro Enterprise
Пакет | Описание |
|---|---|
| Пакет верхнего уровня, устанавливающий и настраивающий Postgres Pro для серверных и клиентских систем. Не используйте этот пакет при обновлении или миграции. ВажноПри установке пакета |
| Стандартные клиентские приложения, такие как psql и pg_dump. |
| Общие библиотеки, требующиеся для развёртывания клиентских приложений, включая libpq; библиотеки времени выполнения для обработчика ECPG. |
| Сервер Postgres Pro и серверный язык программирования PL/pgSQL. |
| Дополнительные расширения и программы, разворачиваемые на серверах баз данных. |
| Заголовочные файлы и библиотеки для разработки клиентских приложений и серверных расширений. В системах на базе Debian этот пакет называется |
| Реализация языка Perl для программирования на стороне сервера (см. Главу 48). |
| Реализация языка Python 3 для программирования на стороне сервера (см. Главу 49). |
| Реализация языка Tcl для программирования на стороне сервера (см. Главу 47). |
| Документация на английском языке. |
| Документация на русском языке. |
| Тестовые скрипты для сервера. Этот пакет представлен только для систем на базе RHEL и SUSE. |
| Этот пакет обеспечивает поддержку JIT-компиляции. Этот пакет предоставляется только для архитектуры x86_64 и только для поддерживаемых систем Debian и Ubuntu, Astra Linux 1.7/1.8, поддерживаемых систем Альт, Rocky Linux 8/9, Oracle Linux 8/9, AlmaLinux 9, SLES 15 и RHEL 8/9. Этот пакет недоступен в сертифицированной редакции. Чтобы узнать об использовании JIT больше, обратитесь к Главе 32. |
| mamonsu — агент мониторинга для сбора метрик Postgres Pro и операционной системы. |
| Расширение pg_failover_slots для автоматического создания и синхронизации слотов логической репликации на физических репликах. |
| Расширение, позволяющее модифицировать курсоры Postgres Pro. |
| Утилита pg_probackup. |
| Утилита pgpro_controldata, показывающая управляющую информацию кластера БД PostgreSQL/Postgres Pro и параметры совместимости кластера и/или сервера. |
| Утилита pgpro_datactl для управления файлами данных Postgres Pro. |
| Расширение pgpro_multiplan, позволяющее сохранять планы выполнения запросов для последующего использования или фиксировать определённый план выполнения. |
| Расширение pgpro_planner, предоставляющее преобразования и оптимизации запросов для создания эффективных планов выполнения запросов и улучшения производительности. Этот пакет недоступен в сертифицированной редакции. |
| Данный пакет предоставляет пакеты для следующих расширений: utl_http, utl_mail и utl_smtp. |
| Расширение pgpro_pwr, позволяющее получать отчёты по нагрузке, полезные для выявления наиболее ресурсоёмких операций в базе данных. |
| Расширение pgpro_result_cache, позволяющее сохранять результаты запросов для повторного использования. Этот пакет недоступен в сертифицированной редакции. |
| Утилита командной строки pgpro_scout для обнаружения чувствительной (конфиденциальной) информации в базе данных. Этот пакет недоступен в сертифицированной редакции. |
| Расширение pgpro_stats, собирающее статистику выполнения SQL-операторов, подсчитывающее статистику событий ожидания и предоставляющее прочие полезные метрики. |
| Экспериментальное расширение sr_plan, позволяющее пользователям сохранять отдельные планы параметризованных запросов для использования в будущем вне зависимости от изменения параметров планировщика. Это расширение признано устаревшим, используйте вместо него расширение pgpro_multiplan. |
| Утилита pgpro_validate для проверки целостности данных экземпляра Postgres Pro. |
Также Postgres Pro включает библиотеки и утилиты, необходимые для предоставляемых пакетов и сервера Postgres Pro. Эти пакеты предоставляются только для дистрибутивов, в которых отсутствует требуемая версия таких библиотек.
Таблица 17.2. Сторонние библиотеки и утилиты, собранные для Postgres Pro Enterprise
Библиотека/утилита | Описание |
|---|---|
| Библиотека для быстрого сжатия данных без потерь. |
| Библиотека для быстрого сжатия данных без потерь. Этот пакет недоступен в сертифицированной редакции. |
| Библиотека для реализации протокола TDS. Используется расширением Этот пакет недоступен в сертифицированной редакции. |
| Библиотека для раскрутки стека, используемая параметром Этот пакет недоступен в сертифицированной редакции. |
| Библиотека для обратной трассировки стека, используемая параметром |
| Библиотека для реализации протокола TDS. Предоставляется для SLES 15. Этот пакет недоступен в сертифицированной редакции. |
| Две библиотеки Perl, используемые в рамках TAP-тестирования и доступные в пакете |
Кроме этого, имеются отдельные пакеты с несколькими дополнительными модулями, собранные специально для совместимости с Postgres Pro Enterprise:
Таблица 17.3. Сторонние пакеты, собранные для Postgres Pro Enterprise
Пакет | Описание |
|---|---|
| apache-age — это расширение, добавляющее в Postgres Pro функциональность для работы с графовыми базами данных. |
| citus — это расширение, совместимое с Postgres Pro и предоставляющее такие основные функциональные возможности, как столбцовое хранение и распределённая база данных OLAP. Этот пакет недоступен в сертифицированной редакции. |
| Расширение hypopg, обеспечивающее поддержку гипотетических индексов в Postgres Pro. Этот пакет недоступен в сертифицированной редакции. |
| Утилита ldap2pg для автоматизации процесса создания, обновления и удаления ролей и пользователей Postgres Pro из корпоративного каталога. Этот пакет недоступен в сертифицированной редакции. |
| Драйвер открытого соединения с базами данных (open database connectivity, ODBC) для доступа к системам управления базами данных. В качестве альтернативы можно использовать Этот пакет недоступен в сертифицированной редакции. |
| Расширение oracle_fdw, предоставляющее обёртку сторонних данных для доступа к базам данных Oracle. Этот пакет предоставляется только для операционных систем на платформе Intel. Этот пакет недоступен в сертифицированной редакции. |
| В этом пакете представлены реализации некоторых функций, которые существуют в СУБД Oracle, но отсутствуют в Postgres Pro (или работают немного по-другому). |
| Утилита pg_filedump, представляющая файлы кучи и индексов, а также управляющие файлы Postgres Pro в понятном человеку виде. |
| Утилита pgbouncer_exporter, экспортирующая метрики Prometheus для pgbouncer. |
| Модуль pg_hint_plan, управляющий планом выполнения запроса с помощью указаний для планировщика. |
| pg_repack — расширение Postgres Pro и утилита для реорганизации таблиц. |
| pgbouncer — пул соединений для Postgres Pro. |
| Расширение pgpro_anonymizer, позволяющее маскировать или заменять конфиденциальные коммерческие данные или информацию, по которой можно установить личность, в БД Postgres Pro. |
| pgbadger — анализатор журналов Postgres Pro, генерирующий подробные отчёты и графики. |
| Расширение pgvector, предоставляющее поиск сходства векторов в Postgres Pro. |
| Набор разделяемых библиотек, реализующих API для отладки функций PL/pgSQL в Postgres Pro. |
| Модуль pljava, позволяющий использовать хранимые процедуры, триггеры и функции, написанные на языке Java, в Postgres Pro. Этот пакет недоступен в сертифицированной редакции. |
| Расширение plpgsql_check, предоставляющее возможность статического анализа кода для PL/pgSQL в Postgres Pro. |
| Разделяемая библиотека PLV8, добавляющая в Postgres Pro поддержку процедурного языка Javascript в реализации V8. Этот пакет предоставляется только для систем Debian и Ubuntu, Astra Linux 1.7/1.8, SLES 15, RHEL 8/9/10 и РЕД ОС 7.3/8. Этот пакет недоступен в сертифицированной редакции. |
| Расширение tds_fdw, предоставляющее обёртку сторонних данных для подключения к Microsoft SQL Server и другим базам данных, использующим протокол TDS (Tabular Data Stream, Поток табличных данных). |
| Расширение wal2json для логического декодирования, которое преобразует изменения базы данных из журнала предзаписи (WAL) в формат JSON. |
| Утилиты командной строки для библиотеки |
Кроме того, Postgres Pro предоставляет отдельные пакеты с отладочной информацией для некоторых операционных систем:
В системах на базе Debian это пакет
postgrespro-ent-16-dbg.В системах на базе RHEL это пакет
postgrespro-ent-16-debuginfo.В ОС Альт Линукс для всех пакетов с двоичными файлами имеются соответствующие пакеты
-debuginfo.
Для серверных инсталляций требуются как минимум следующие пакеты:
postgrespro-ent-16-serverpostgrespro-ent-16-clientpostgrespro-ent-16-libs
Для использования дополнительных расширений Postgres Pro вы должны также установить пакет postgrespro-ent-16-contrib. В системах на базе Debian пакет postgrespro-ent-16-server зависит от пакета postgrespro-ent-16-contrib, поэтому последний должен всегда устанавливаться вместе с сервером.
Для клиентских инсталляций обычно достаточно установить пакеты postgrespro-ent-16-client и postgrespro-ent-16-libs. Если вы используете независимые приложения и вам не нужны стандартные клиентские утилиты, такие как psql, вы можете установить только пакет postgrespro-ent-16-libs.
Для рабочих станций разработчиков необходимый минимум составляют следующие пакеты:
postgrespro-ent-16-libspostgrespro-ent-16-devel/postgrespro-ent-16-dev
Также вы можете установить и настроить сервер с тестовой базой данных. Подробнее о настройке, которая может потребоваться дополнительно, рассказывается в Подразделе 17.1.7.
17.1.6.2. Настройка автоматического запуска сервера #
Если вы производите расширенную установку, автоматический запуск сервера по умолчанию отключается. После создания базы данных по умолчанию вы можете настроить автоматический запуск сервера при загрузке системы, используя имеющиеся в вашей операционной системе механизмы управления службами или сторонние средства обеспечения высокой степени доступности. Для облегчения этой задачи в пакете postgrespro-ent-16-server поставляется скрипт pg-setup, помещаемый в каталог /opt/pgpro/ent-16/bin.
Для настройки автозапуска сервера запустите скрипт pg-setup со следующими параметрами:
pg-setup service enable
Если требуется, вы можете отключить автозапуск сервера, используя тот же скрипт:
pg-setup service disable
Вы также можете использовать системные средства управления службами, непосредственно задействуя скрипты для систем инициализации SysV init.d и systemd, предоставляемые в пакете postgrespro-ent-16-server. В зависимости от дистрибутива Linux Postgres Pro поддерживает следующие механизмы управления службами:
Дистрибутив Linux | Предоставляемые скрипты |
|---|---|
Системы на базе RHEL, SLES 15 | Файл службы systemd |
Debian, Ubuntu, Альт 10/11 | И файл службы systemd, и скрипт init.d в стиле SysV |
Для включения автоматического запуска сервера средствами systemd выполните следующую команду:
systemctl enable postgrespro-ent-16
Для использования скрипта init.d в стиле SysV:
В системах Альт Линукс выполните следующую команду:
systemctl enable postgrespro-ent-16
В системах Debian воспользуйтесь скриптом
update-rc.d. За подробностями обратитесь к соответствующей странице man.
17.1.7. Установка на рабочих станциях разработчиков #
Хотя может быть достаточно установить пакеты postgrespro-ent-16-libs и postgrespro-ent-16-devel/postgrespro-ent-16-dev, обычно на машинах разработчиков удобно иметь и установленный сервер. Для быстрой установки вы можете воспользоваться пакетом postgrespro-ent-16, который автоматически настроит предоставляемые клиентские и серверные программы, а также создаст начальную базу данных. Однако если вы планируете использовать одновременно несколько продуктов на базе PostgreSQL, следуйте инструкциям по расширенной установке, приведённым в Подразделе 17.1.6.
Чтобы скомпилировать программы с библиотеками Postgres Pro, используя утилиту pg_config, поставляемую с Postgres Pro, необходимо, чтобы её путь был указан в переменной PATH до путей каких-либо других версий pg_config. Заметьте, что в системах на базе RHEL pg_config не добавляется в PATH автоматически. Если в вашей системе нет других версий pg_config, вы можете воспользоваться утилитой pg-wrapper, поставляемой в пакете postgrespro-ent-16-client, для создания символической ссылки на pg_config в стандартном каталоге исполняемых файлов.
Для компиляции программ с использованием pkg-config добавьте путь /opt/pgpro/ent-16/lib/pkgconfig/ в переменную среды PKG_CONFIG_PATH.
Если вы хотите компилировать расширения Postgres Pro с поддержкой встраивания JIT, выполните дополнительные требования:
Установите пакет LLVM для разработки и компилятор Clang. Вы должны выбрать пакеты той же версии, какая использовалась для сборки пакета
postgrespro-ent-16-jit, устанавливаемом на сервере. Определить версию, требующуюся для текущего выпуска Postgres Pro, вы можете по значениюCLANGв файле/opt/pgpro/ent-16/lib/pgxs/src/Makefile.global.Выполняя команды
makeиmake install, добавьте параметрwith-llvm=yesдля компиляции и установки файлов с битовым кодом для вашего расширения. По умолчанию компиляции битового кода отключена, так как она зависит от доступности компилятора Clang.
17.1.7.1. Использование сторонних программ с Postgres Pro #
Чтобы использовать сервер Postgres Pro с клиентской программой из стороннего продукта, вы можете установить версию библиотек PostgreSQL, с которыми компилировалась эта программа. Например, если программа поставляется в составе ванильного PostgreSQL, вам может потребоваться установить пакеты libpq или postgresql-libs, предоставляемые для вашего дистрибутива Linux. В этом случае программа, возможно, не будет использовать некоторые новые возможности сервера Postgres Pro, но скорее всего она и не поддерживает их.
Если вы предпочитаете использовать библиотеки Postgres Pro со сторонней программой или хотели бы задействовать новую возможность, которая не требует изменения самого клиентского приложения, например, проверку подлинности SCRAM, вы можете перекомпилировать вашу программу с библиотеками Postgres Pro.
Важно
Если программа скомпилирована с одной версией libpq, а используется с другой, её стабильная работа не гарантируется.
Если вы создаёте пакеты .rpm или .deb для вашей программы, рекомендуется сделать следующее:
Добавьте путь
/opt/pgpro/ent-16/binв переменнуюPATHв сборочных скриптах (в файле.specилиdebian/rules).Добавьте
postgrespro-ent-16-devв тегиBuildDependsилиBuildRequiresописания пакета вашей программы.
Тем самым вы обеспечите вызов в процессе создания пакетов нужной версии pg_config при каждой пересборке пакета исходного кода.
17.1.8. Настройка нескольких экземпляров Postgres Pro #
Чтобы настроить в Linux несколько экземпляров сервера Postgres Pro с разными каталогами данных, нужно проделать следующее:
Установите и настройте Postgres Pro, следуя указаниям в Подразделе 17.1.5 или Подразделе 17.1.6.
После создания начальной базы данных запустите initdb и укажите путь к другому каталогу данных и любые другие параметры, требующиеся для инициализации другого экземпляра сервера.
Задайте другие порты для экземпляров серверов в соответствующих файлах
postgresql.conf, чтобы не допустить конфликтов.Если требуется, настройте автоматический запуск сервера следующим образом:
Создайте копию файла
/etc/init.d/postgrespro-ent-16или/lib/systemd/system/postgrespro-ent-16.serviceс другим именем и поменяйте в ней путь к каталогу данных.Включите автоматический запуск сервера, используя скрипты автозапуска, предоставленные для вашего системного механизма управления службами, вместо
pg-setup, как описано в Подразделе 17.1.6.2. Убедитесь в том, что вы используете переименованные копии скриптов, созданные на шаге 1.
17.1.9. Замечания о совместимости с антивирусами #
Настоятельно не рекомендуется использовать антивирусное ПО в системах, где работает Postgres Pro, так как антивирус создаёт дополнительную нагрузку и может оказывать непредсказуемое влияние на работу базы данных, что чревато проблемами с производительностью и надёжностью. Если вам необходимо использовать антивирусное ПО, обязательно добавьте в исключения антивируса следующие каталоги, так как они не содержат исполняемых файлов:
Каталог
PGDATAс основными данными кластера (обычно/var/lib/pgpro/ent-16/dataили другой каталог, заданный в параметрах initdb)Каталоги созданных табличных пространств
Каталог с WAL-файлами (за подробной информацией обратитесь к Разделу 25.3)
Каталог с исполняемыми файлами СУБД (обычно
/opt/pgpro/ent-16/bin)
17.1. Installing Postgres Pro Enterprise #
- 17.1.1. Supported Linux Distributions
- 17.1.2. Supported Linux Distributions for the Certified Edition
- 17.1.3. Adding Package Repository
- 17.1.4. Providing a Public Key in Astra Linux
- 17.1.5. Quick Installation and Setup
- 17.1.6. Custom Installation
- 17.1.7. Setting up Development Workstations
- 17.1.8. Configuring Multiple Postgres Pro Instances
- 17.1.9. Antivirus Considerations
- 17.1.2. Supported Linux Distributions for the Certified Edition
Postgres Pro only runs on Linux-based operating systems, and it is shipped as binary packages. Each Postgres Pro binary distribution consists of several packages. The package structure differs from vanilla PostgreSQL and offers the following installation modes:
Quick installation and setup. The
postgrespro-ent-16package installs and configures all the components required for a viable ready-to-use configuration of both server and client components. Choose this option if you are going to install a single Postgres Pro instance only, and you are not worried about possible conflicts with other PostgreSQL-based products.Important
Installing the
postgrespro-ent-16package can delete existing installations of Postgres Pro and PostgreSQL-based products. Similarly, this Postgres Pro installation may be automatically removed if you later install another PostgreSQL-based product. Do not use this package for upgrades or migrations, or if you are going to maintain several installations on the same system.Custom installation. You can select any packages required for your purposes, including development packages. This option needs manual configuration, so a good grasp of Linux and understanding of PostgreSQL architecture are required. This is the only option to choose if you are going to use Postgres Pro in one of the following scenarios:
Install several Postgres Pro versions side by side, or together with other PostgreSQL-based products.
Perform an upgrade from a previous version, or migrate from a different PostgreSQL-based product.
Control Postgres Pro server execution using high availability software, such as pacemaker, instead of the standard system service management facility.
The minimum hardware required to install Postgres Pro, create a database cluster and start the database server are as follows:
1-GHzprocessor1 GBof RAM1 GBof disk space
Additional disk space is required for data or supporting components.
17.1.1. Supported Linux Distributions #
Postgres Pro binary packages are available for the following Linux-based systems:
Linux systems for x86-64 architecture:
Red Hat Enterprise Linux (RHEL) systems and its derivatives: Red Hat Enterprise Linux 8/9/10, Rocky Linux 9/10, Oracle Linux 9/10, AlmaLinux 9/10, Red OS Murom 7.3/8, ROSA Chrome 2021.1
Debian-based systems: Debian 11/12/13, Ubuntu 22.04/24.04, Astra Linux 1.7/1.8
ALT 10/11, ALT SP 8.2, ALT SP Release 10
SUSE Linux Enterprise Server (SLES) 15
Linux systems for Elbrus CPU architecture: ALT 10 for e2kv3/e2kv4, ALT SP 8.2 for e2kv3/e2kv4, ALT SP Release 10 for e2kv3/e2kv4, Astra Linux Leningrad 8.1, Elbrus OS 3.9
Linux systems for ARM architecture: RHEL 8/9/10, Rocky Linux 9/10, Oracle Linux 9/10, AlmaLinux 9/10, Red OS Murom 7.3/8, Debian 11/12/13, Ubuntu 22.04/24.04, ALT 10/11, ALT SP 8.2, ALT SP Release 10, Astra Linux Novorossiysk
Note
Postgres Pro binary packages rely on the tzdata library provided by the operating system, so you must ensure that the latest available version is installed. If tzdata is outdated, the time in your database may be incorrect.
17.1.2. Supported Linux Distributions for the Certified Edition #
Postgres Pro binary packages are available for the following Linux-based systems:
Linux systems for x86-64 architecture:
Astra Linux Special Edition 1.7/1.8
ALT SP 8/8.2/8.4, ALT SP Release 10
RED OS 7.3/8
ROSA Chrome 2021.1
Linux systems for Elbrus CPU architecture:
ALT SP 8 for e2k/e2kv4
ALT SP Release 10 for e2k/e2kv4
Astra Linux Special Edition Leningrad 8.1 for e2k-8c
Note
Postgres Pro binary packages rely on the tzdata library provided by the operating system, so you must ensure that the latest available version is installed. If tzdata is outdated, the time in your database may be incorrect.
17.1.3. Adding Package Repository #
Important
Postgres Pro Enterprise Certified cannot be installed or updated from the package repository.
In compliance with the Federal Service for Technical and Export Control (FSTEC) requirements, Postgres Pro Enterprise Certified is delivered on USB flash drives with an ISO image that includes the database installation packages, extensions, documentation, and checksum files.
Alternatively, you can request an installation disc or download the packages from your personal account over the encrypted channel. For more information, contact the Postgres Pro Enterprise support team or the sales team.
Installation of Postgres Pro Enterprise Certified is described in the “Installing the Database” chapter of the Security Toolkit Manual (in Russian).
Before installing Postgres Pro from binary packages using the package manager of your operating system, you need to add the Postgres Pro package repository.
To access the repository, you will need a valid technical support certificate and an access key from the personal account in the technical support portal.
To add the repository, complete the following steps:
Make sure that the wget utility is installed and can access the Internet.
The script requires wget and the Internet access to check the validity of the credentials when adding the repository.
Note
It is not possible to use a SOCKS5 proxy for accessing the Internet as wget does not support this type of proxy.
Get the access key for the repository:
Open your personal account in the technical support portal and go to → → .
Access keys are available only to license set administrators.
Download the
pgpro-repo-add.shBash script:wget --user access_key --password='' https://repo.postgrespro.ru/ent/ent-16/keys/pgpro-repo-add.sh
This script adds the repository so that the package manager of your operating system can use it.
(Optional) Examine the content of the script, if necessary.
Run the script as
root(e. g. using sudo).When prompted, enter the access credentials.
Important
If no credentials are provided or they are invalid, the script will offer to add the repository without credentials.
If you proceed without credentials, you will be required to manually provide the credentials later in order to access the repository.
Now you are ready to install Postgres Pro Enterprise using the package manager of your operating system.
17.1.4. Providing a Public Key in Astra Linux #
To be able to install Postgres Pro Enterprise in Astra Linux in secure software environment (SSE) mode, you must provide the public key used for signing the Postgres Pro Enterprise binaries.
To add the public key, complete the following steps:
Download the
SSE-ASTRA-GPG-POSTGRESPROpublic key file for Astra Linux from the Postgres Pro repository.The public key file from the repository is in the ASCII format. However, the secure software environment in Astra Linux requires the public key in the binary format.
Convert the key file from the ASCII format to the binary format:
gpg --dearmor --output pgpro-astra.key SSE-ASTRA-GPG-POSTGRESPRO
Copy the public key in the binary format to
/etc/digsig/keys/.Ensure that the following parameters are added to
/etc/digsig/digsig_initramfs.conf:DIGSIG_ELF_MODE=1 DIGSIG_XATTR_MODE=0 DIGSIG_IGNORE_XATTR_KEYS=0 DIGSIG_IGNORE_GOST2001=0
Update the initramfs image:
sudo update-initramfs -u -k all
Restart the machine.
Proceed to the installation.
17.1.5. Quick Installation and Setup #
If you only need to install a single Postgres Pro instance and are not going to use any other PostgreSQL-based products on your system, you can use the quick installation mode. The typical process is as follows:
Add the package repository required for your operating system.
Install the
postgrespro-ent-16package. It will bring all the required components via dependencies, create the default database, start the database server, as well as enable server autostart at system boot and make all the provided programs available inPATH.
Note
By default, the database configuration is set for the Postgres Pro product being installed. If you need your database configured for a different product, choose custom installation and use the tune argument of the pg-setup initdb command.
Once the installation completes, you can launch psql on behalf of the postgres user and connect to the newly created database, which is located in the /var/lib/pgpro/ent-16/data directory.
Since the default database is created using the pg-setup script, the path to its data directory is stored in the /etc/default/postgrespro-ent-16 file. All the subsequent pg-setup commands, as well as any commands that manage Postgres Pro service, affect this database only. In this file, you can also change the value of PG_OOM_ADJUST_VALUE for postmaster child processes (see Section 18.4.4 for details).
17.1.6. Custom Installation #
Splitting the distribution into multiple packages enables customizing the installation for different purposes: database servers, client systems, or development workstations. Custom installations need to be configured manually, but give you more flexibility in using the product. You can install several Postgres Pro versions side by side, as well as together with other PostgreSQL-based products. In particular, this may be required when performing upgrades, or migrating from a different PostgreSQL-based product.
To perform a custom installation, complete the following steps:
Add the package repository required for your operating system.
Choose Postgres Pro packages required for your purposes and install them using the standard installation commands for your Linux distribution. The available packages are listed in Table 17.1.
As a result, all files get installed into the
/opt/pgpro/ent-16directory.Run pg-wrapper as root to make the installed client and server programs available via
PATHand add SQL man pages to the man page configuration file. This utility is provided in thepostgrespro-ent-16-clientpackage./opt/pgpro/ent-16/bin/pg-wrapper links update
For details on how to handle possible conflicts, see pg-wrapper description.
If you chose to install the
postgrespro-ent-16-serverpackage, make sure to complete the following server setup:Create the default database by running the helper script pg-setup as root with the
initdboption:/opt/pgpro/ent-16/bin/pg-setup initdb [
initdb_options]where:
the
tunecommand-line argument sets the database configuration.initdb_optionsare regular initdb options.
Note
By default, pg-setup initializes the database cluster with checksums enabled. If this is not what you expect, specify the
--no-data-checksums.The
pg-setupscript performs database administration operations as userpostgres. If you do not specify any initdb options, the default database is created in the/var/lib/pgpro/ent-16/datadirectory, using localization settings specified in theLANGenvironment variable for the current session. All theLC_*environment variables are ignored.Since the default database is created using the pg-setup script, the path to its data directory is stored in the
/etc/default/postgrespro-ent-16file. All the subsequent pg-setup commands, as well as any commands that manage Postgres Pro service, affect this database only. In this file, you can also change the value ofPG_OOM_ADJUST_VALUEfor postmaster child processes (see Section 18.4.4 for details).Start the server by running
pg-setupas root, as follows:/opt/pgpro/ent-16/bin/pg-setup service start
Like vanilla PostgreSQL, Postgres Pro server runs on behalf of the
postgresuser.Note
By default, automatic server startup is disabled, so you can manually control the database recovery after a system reboot. Optionally, you can configure the Postgres Pro server to start automatically. For details, see Section 17.1.6.2.
17.1.6.1. Choosing the Packages to Install #
The table below lists all the available Postgres Pro Enterprise packages.
Table 17.1. Postgres Pro Enterprise Packages
Package | Description |
|---|---|
| Top-level package that installs and configures Postgres Pro for server and client systems. Do not use this package for upgrades or migrations. Important Installing the |
| Standard client applications, such as psql or pg_dump. |
| Shared libraries required to deploy client applications, including libpq; runtime libraries for ECPG processor. |
| Postgres Pro server and PL/pgSQL server-side programming language. |
| Additional extensions and programs deployable on database servers. |
| Header files and libraries for developing client applications and server extensions. On Debian-based systems, this package is called |
| Server-side programming language based on Perl (see Chapter 48). |
| Server-side programming language based on Python 3 (see Chapter 49). |
| Server-side programming language based on Tcl (see Chapter 47). |
| Documentation (English). |
| Documentation (Russian). |
| Test scripts for the server. This package is only available on RHEL-based and SUSE systems. |
| This package provides support for Just-in-Time (JIT) compilation. This package is available only for x86_64 architecture and only for the supported Debian and Ubuntu systems, Astra Linux 1.7/1.8, supported ALT systems, Rocky Linux 8/9, Oracle Linux 8/9, AlmaLinux 9, SLES 15, and RHEL 8/9. This package is not available in the certified product edition. To learn more about enabling and using JIT, see Chapter 32. |
| mamonsu — a monitoring agent for collecting Postgres Pro and system metrics. |
| pg_failover_slots extension for automatic creation and synchronization of logical replication slots on physical replicas. |
| An extension to modify Postgres Pro cursors. |
| pg_probackup utility. |
| pgpro_controldata application to display control information of a PostgreSQL/Postgres Pro database cluster and compatibility information for a cluster and/or server. |
| pgpro_datactl utility to manage Postgres Pro data files. |
| pgpro_multiplan extension that allows you to save query execution plans for future usage or lock a specific execution plan. |
| pgpro_planner extension that provides query transformations and optimizations to produce efficient query execution plans and improve performance. This package is not available in the certified product edition. |
| This package provides packages for these extensions: utl_http, utl_mail, and utl_smtp. |
| pgpro_pwr extension that enables you to generate workload reports, which help to discover most resource-intensive activities in your database. |
| pgpro_result_cache extension to save query results for reuse. This package is not available in the certified product edition. |
| pgpro_scout command-line utility to detect sensitive (confidential) information in a database. This package is not available in the certified product edition. |
| pgpro_stats extension that tracks execution statistics of SQL statements, calculates wait event statistics and provides other useful metrics. |
| sr_plan experimental extension that allows the user to save a specific plan of a parameterized query for future usage regardless of how planner settings may change. This extension is considered deprecated, use the pgpro_multiplan extension instead. |
| pgpro_validate utility to check data integrity of a Postgres Pro instance. |
Also, Postgres Pro includes libraries and utilities required for the Postgres Pro server and provided packages. These packages are only provided for the distributions that don't include the required versions of these libraries.
Table 17.2. Third-party libraries and utilities for Postgres Pro Enterprise
Library/utility | Description |
|---|---|
| A library for fast lossless data compression. |
| A library for fast lossless data compression. This package is not available in the certified product edition. |
| A library that implements TDS protocol. It is used by the This package is not available in the certified product edition. |
| A stack unwinding library used by This package is not available in the certified product edition. |
| A backtrace library used by |
| A library that implements TDS protocol. This package is provided for SLES 15. This package is not available in the certified product edition. |
| Two Perl libraries used in the TAP test framework available in the |
Besides, there are separate packages providing several external modules that have been pre-built for compatibility with Postgres Pro Enterprise:
Table 17.3. Third-party Packages Built for Postgres Pro Enterprise
Package | Description |
|---|---|
| apache-age is a Postgres Pro extension that provides graph database functionality. |
| citus is an extension that is made compatible with Postgres Pro and provides such major functionalities as columnar data storage and distributed OLAP database. This package is not available in the certified product edition. |
| hypopg extension, which provides support for hypothetical indexes in Postgres Pro. This package is not available in the certified product edition. |
| ldap2pg utility to automate the creation, update, and removal of Postgres Pro roles and users from an enterprise directory. This package is not available in the certified product edition. |
| An Open Database Connectivity (ODBC) driver for accessing database management systems (DBMS). This package is not available in the certified product edition. |
| oracle_fdw extension that provides a foreign data wrapper for Oracle. This package is only available for the supported Intel-based operating systems. This package is not available in the certified product edition. |
| This package implements in Postgres Pro some of the functions from the Oracle database that are missing (or behaving differently). |
| pg_filedump utility to format Postgres Pro heap/index/control files into a human-readable form. |
| pgbouncer_exporter utility to export Prometheus metrics for pgbouncer. |
| pg_hint_plan module that controls the execution plan by providing hints to the planner. |
| pg_repack extension and utility for reorganizing tables. |
| pgbouncer — a connection pooler for Postgres Pro. |
| pgpro_anonymizer extension that provides the ability to mask or replace personally identifiable information or commercially sensitive data from a Postgres Pro database. |
| pgbadger — Postgres Pro log analyzer that provides detailed reports and graphs. |
| pgvector extension that provides vector similarity search for Postgres Pro. |
| A set of shared libraries that implement an API for debugging PL/pgSQL functions in Postgres Pro. |
| pljava module that brings Java stored procedures, triggers, and functions to the Postgres Pro backend. This package is not available in the certified product edition. |
| plpgsql_check extension that provides static code analysis for PL/pgSQL in Postgres Pro. |
| The shared library PLV8 that provides a Postgres Pro procedural language powered by V8 Javascript Engine. This package is only available for the supported Debian and Ubuntu systems, Astra Linux 1.7/1.8, SLES 15, RHEL 8/9/10, and Red OS 7.3/8. This package is not available in the certified product edition. |
| tds_fdw extension that provides a foreign data wrapper to connect to Microsoft SQL Server and other databases that use the Tabular Data Stream (TDS) protocol. |
| wal2json extension for logical decoding that converts database changes from the write-ahead log (WAL) into JSON format. |
| Command-line utility for the |
Additionally, Postgres Pro provides separate packages with debug information for some operating systems:
On Debian-based systems, see the
postgrespro-ent-16-dbgpackage.On RHEL-based systems, see the
postgrespro-ent-16-debuginfopackage.On ALT Linux systems, all packages containing binary files have the corresponding
-debuginfopackages.
Server installations require at least the following packages:
postgrespro-ent-16-serverpostgrespro-ent-16-clientpostgrespro-ent-16-libs
To use additional Postgres Pro extensions, you must also install the postgrespro-ent-16-contrib package. On Debian-based systems, postgrespro-ent-16-server package depends on postgrespro-ent-16-contrib package, so the latter must always be installed together with the server.
For client installations, it is usually enough to install the postgrespro-ent-16-client and postgrespro-ent-16-libs packages. If you use custom applications and do not need standard client utilities such as psql, you can install the postgrespro-ent-16-libs package only.
Development workstations require at least the following packages:
postgrespro-ent-16-libspostgrespro-ent-16-devel/postgrespro-ent-16-dev
You may also want to install and configure the server with a test database on development systems. For details on additional configuration that may be required, Section 17.1.7.
17.1.6.2. Enabling Automatic Server Startup #
If you are running a custom installation, automatic server startup is disabled by default. Once the default database is created, you can configure the server to start automatically upon system boot using service management solutions available in your operating system or third-party high-availability software. To facilitate this task, postgrespro-ent-16-server package provides the pg-setup script, which is installed in the /opt/pgpro/ent-16/bin directory.
To enable server autostart, run the pg-setup script with the following options:
pg-setup service enable
If required, you can disable server autostart using the same script:
pg-setup service disable
Alternatively, you can use system service management solutions directly by running the autostart scripts for SysV-style init.d and systemd provided in the postgrespro-ent-16-server package. Depending on your Linux distribution, Postgres Pro supports different service management solutions:
Linux Distribution | Provided Scripts |
|---|---|
RHEL-based systems, SLES 15 | systemd unit file |
Debian, Ubuntu, ALT 10/11 | Both systemd unit file and SysV-style init.d script |
To use systemd for automatic server startup, run the following command:
systemctl enable postgrespro-ent-16
To use SysV-style init.d script:
On ALT Linux systems, run the following command:
systemctl enable postgrespro-ent-16
On Debian systems, use
update-rc.d. See the corresponding man page for details.
17.1.7. Setting up Development Workstations #
While installing postgrespro-ent-16-libs and postgrespro-ent-16-devel/ postgrespro-ent-16-dev packages may be enough, it is usually convenient to have the server set up on the development system. For quick setup, you can install postgrespro-ent-16 package, which automatically configures the provided client and server programs and creates the default database. However, if you are going to use several PostgreSQL-based products simultaneously, follow the custom installation instructions in Section 17.1.6.
To compile programs with Postgres Pro libraries using the pg_config utility shipped with Postgres Pro, make sure it appears before the path to other pg_config versions, if any. Note that on RHEL-based systems pg_config is not added to PATH automatically. If you do not have any other pg_config versions on your system, you can use pg-wrapper provided in the postgrespro-ent-16-client package to create a symbolic link to pg_config in the standard binary directory.
To compile programs using pkg-config command, add the /opt/pgpro/ent-16/lib/pkgconfig/ path to the PKG_CONFIG_PATH environment variable.
If you would like to compile Postgres Pro extensions that support JIT inlining, make sure to meet the following additional requirements:
Install LLVM development package and Clang compiler. You must choose the packages of the same version that was used for the
postgrespro-ent-16-jitto be installed on the server. To determine the required version for the current Postgres Pro release, check theCLANGvalue in the/opt/pgpro/ent-16/lib/pgxs/src/Makefile.globalfile.When running
makeormake installcommands, specify thewith-llvm=yesoption to compile and install bitcode files for your extension. By default, bitcode compilation is disabled as it depends on Clang compiler availability.
17.1.7.1. Using Third-Party Programs with Postgres Pro #
To use Postgres Pro server with a client program provided with a third-party product, you can install the version of PostgreSQL libraries that was used to compile this program. For example, if this program is provided with vanilla PostgreSQL, you may need to install the libpq or postgresql-libs packages available for your Linux distribution. In this case, the program may not be able to use some new features of Postgres Pro server, but it is probably not designed to use them anyway.
If you prefer to use Postgres Pro libraries with a third-party program, or would like to enable support for a new feature that does not require client application change, such as SCRAM authentication, you can recompile your program with Postgres Pro libraries.
Important
If the program is compiled with one version of libpq but used with another, its stable work cannot be guaranteed.
If you are creating .rpm or .deb packages for your program, it is recommended to do the following:
Add
/opt/pgpro/ent-16/bintoPATHinside your build scripts (.specfiles ordebian/rules).Specify
postgrespro-ent-16-devin theBuildDependsorBuildRequirestags for your program.
Thus, you can ensure that your package build process calls the right version of pg_config whenever the source package is rebuilt.
17.1.8. Configuring Multiple Postgres Pro Instances #
To set up several Postgres Pro server instances with different data directories on Linux, do the following:
Install and configure Postgres Pro as explained in Section 17.1.5 or Section 17.1.6.
Once the first default database is created, run initdb specifying the path to a different data directory and any other parameters required to initialize another server instance.
Specify different ports for your server instances in the corresponding
postgresql.conffiles to avoid conflicts.If required, configure automatic server startup, as follows:
Create a copy of
/etc/init.d/postgrespro-ent-16or/lib/systemd/system/postgrespro-ent-16.servicewith a different name, specifying the path to the data directory.Enable automatic server startup using the provided autostart scripts for your system service management facility instead of
pg-setup, as described in Section 17.1.6.2. Make sure to use the renamed copies of the scripts you created in step 1.
17.1.9. Antivirus Considerations #
It is strongly recommended to avoid using antivirus software on systems where Postgres Pro is running because it may cause additional load on your environment and result in unexpected database behavior that would lead to performance and reliability issues. If you need to use antivirus software, make sure to exclude the following directories from virus scanning as they do not contain any executable files:
PGDATAdirectory that stores main cluster data, usually located in/var/lib/pgpro/ent-16/dataunless you specified another directory in initdb optionsPaths to created tablespaces
The directory with WAL files (refer to Section 25.3 for details)
The directory with DBMS executable files, usually located at
/opt/pgpro/ent-16/bin