Guest mode. You can read posts without signing up. Comments, ratings, job contacts and your own posts open after you sign up and accept the rules. What is Kommit →

📚 GuideСервер 1С на Windows и LinuxLinux · часть 10 из 14
Guide contents
Редакция КоммитРедакция портала
commit 95271d2 · 19 days ago

1C Server on Linux, step 3: PostgreSQL for 1C — installation, locale, postgresql.conf, and pg_hba

🌐 Machine-translated from Russian. Show original

In this part:

Which build to install#

A special PostgreSQL build with platform modifications is required for 1C (data types and functions used by 1C). Regular PostgreSQL from the distribution repository is not suitable.

Variants:

  • PostgreSQL for 1C from 1C — the "PostgreSQL Distributions" section on releases.1c.ru, packages for popular distributions;
  • Postgres Pro for 1C from Postgres Professional.

Check the compatibility of the build version with your platform in the 1C documentation.

Installation#

Install build packages as per the provider's instructions (deb packages via apt install ./пакет.deb or repository connection). After installation, make sure the PostgreSQL service is running:

systemctl status postgresql*

Cluster with Russian locale#

The most common mistake is that the PostgreSQL cluster was created with the wrong locale. Check out:

sudo -u postgres psql -c "SELECT datname, datcollate, datctype FROM pg_database;"

The databases must have ru_RU.UTF-8. If not — recreate the cluster before creating 1C databases (data will be deleted):

# пример для Debian/Ubuntu-пакетов: имя версии и кластера посмотрите в pg_lsclusters
sudo pg_dropcluster <версия> main --stop
sudo pg_createcluster <версия> main --locale ru_RU.UTF-8 --start

For builds without pg_*cluster utilities, use initdb with --locale=ru_RU.UTF-8 -E UTF8parameters. Locale ru_RU. UTF-8 must be generated in advance — see step 1.

postgresql.conf#

Guidelines for a 32 GB RAM server where DBMS and 1C are on one machine:

listen_addresses = 'localhost'      # СУБД на той же машине, что и 1С
shared_buffers = 8GB                # ~25% RAM
effective_cache_size = 20GB         # ~50–75% RAM
work_mem = 64MB
maintenance_work_mem = 1GB
temp_buffers = 256MB
max_connections = 300
max_locks_per_transaction = 256
standard_conforming_strings = off   # рекомендация для 1С
escape_string_warning = off
autovacuum = on

1C builds often include additional parameters (for example, online_analyze and plantuner modules) — leave them enabled if the provider recommends them. Restart: sudo systemctl restart postgresql.

pg_hba.conf#

Allow password connection only locally (or only from a 1C server IP if the DBMS is on a separate machine):

# TYPE  DATABASE  USER    ADDRESS          METHOD
local   all       postgres                 peer
host    all       all     127.0.0.1/32     scram-sha-256
host    all       all     ::1/128          scram-sha-256
# если СУБД отдельно: host all usr1c 192.168.1.10/32 scram-sha-256

After editing: sudo systemctl reload postgresql.

Verification#

psql -h 127.0.0.1 -U usr1c -d postgres -c "SELECT version();"

If the connection for usr1c works, databases can be created: step 4.

Comments 00 участников · 0 гостей🔒 Rate and discuss after signing up

Comments · 0

No comments yet.Sign in to comment, rate and see all comments.