3.2.5. Install PostgreSQL
3.2.5.1. General information
The database server is installed from 1C:Enterprise distribution media. PostgreSQL DBMS is supported both on Windows and Linux.
When you initialize a database cluster, specify UTF-8 encoding.
1C:Enterprise 8 supports the following tablespaces for PostrgeSQL operations:
- For data: v81c_data.
- For indexes: v81c_index.
If tablespaces with such names exist, they will be used. If not, it is recommended that you create them:
create tablespace v81c_index location <Folder name>; create tablespace v81c_data location <Folder name>;
Where <Folder name> is a full path to the directory where files of the created tablespace will be stored. If the tablespaces do not exist, a tablespace with name pg_default will be used.
To work with 1C:Enterprise, a modified version of PostgreSQL is required. You can get this version on the ITS disk or at: https://releases.1c.ru/project/AddCompPostgre (requires IT-support section access).
1C:Enterprise can work with a cluster created using the following PostgreSQL DBMS versions:
- PostgreSQL 8.1.5-X.1C – 9.1.2-1.1C
- PostgreSQL 9.2.1-2.1C
- Standard PostgreSQL version if regional (locale) settings of the cluster and the infobase are identical
1C:Enterprise operation with a cluster created by the standard PostgreSQL version is allowed only using the PostgreSQL distribution package released by 1C.
You can switch to an earlier or later version of 1C:Enterprise without having to change PostgreSQL version or perform other actions.
Infobases created using PostgreSQL 9.2.1-2.1C or later cannot be used with the earlier versions of 1C:Enterprise (8.3.2 or earlier). Do not create infobases using PostgreSQL version 9.2.1-2.1C if you expect to access these infobases from earlier 1C:Enterprise versions.
3.2.5.2. Installing PostgreSQL for Windows
To install the version you need:
- Unpack the ZIP archive with the PostgreSQL distribution package.
- Run the postgresql-<Version>-1.1C.msi file, where <Version> is PostgreSQL version to be installed.
- Follow installer instructions.
3.2.5.3. Installing PostgreSQL for Linux
The distribution package of the modified PostgreSQL version consists of 11 packages. You must install them in the following order:
- postgresql-libs-8.3.<X>-<Y>.1C.i386.rpm
- postgresql-8.3.<X>-<Y>.1C.i386.rpm
- postgresql-Server-8.3.<X>-<Y>.1C.i386.rpm
- postgresql-contrib-8.3.<X>-<Y>.1C.i386.rpm
Where <X> and <Y> are corresponding positions in the PostgreSQL version.
After that, the postgres user will appear in the system and the /etc/init.d/postgresql script will be created to start and stop the DBMS.
Next, you need to set the desired value of the LANG variable and run /etc/init.d/postgresql for initial database creation. This can be done with the command:
LANG=ru_RU.utf-8 /etc/init.d/postgresql start
This will create a database located in the /var/lib/pgsql/data directory. All the above actions require superuser (root) rights.