From Exponential 6.0.15, PostgreSQL 13 to 19 are supported and tested, for the site's database and for the DFS cluster metadata. 13 is the minimum. The driver is eZPostgreSQLDB on the PHP extension pgsql; the DFS cluster backend and its gateway use pdo_pgsql.
Create the database and its user
sudo -u postgres createuser --pwprompt exponential sudo -u postgres createdb --owner=exponential --encoding=UTF8 --template=template0 exponential
Make the user the owner of the database: from PostgreSQL 15 on, ordinary users may no longer create tables in the public schema of a database they do not own.
pgcrypto
The driver uses digest() from pgcrypto. The installer runs CREATE EXTENSION IF NOT EXISTS pgcrypto, which the database owner may do because pgcrypto is a trusted extension from 13 on. If the server lacks it, install your distribution's PostgreSQL contrib package and create the extension as the owner.
Settings
[DatabaseSettings] DatabaseImplementation=ezpostgresql Server=localhost Port=5432 User=exponential Password=<the password> Database=exponential UsePersistentConnection=disabled
Install from the console, with the password from the environment so it stays out of the shell history:
EXP_INSTALL_DB_PASSWORD='<the password>' php bin/php/console exp:install --apply --db=pgsql \
--db-host=127.0.0.1 --db-name=exponential --db-user=exponential
Sequences
Auto-increment columns use sequences named <table>_<column>_seq. After loading data with explicit ids, the next insert can fail with a duplicate key. The installer corrects the sequences after loading data; for one table by hand:
SELECT setval('ezcontentobject_id_seq', (SELECT max(id) FROM ezcontentobject));
Backups and clients
Back up with pg_dump -U exponential -Fc exponential > backup.dump and restore with pg_restore. pg_dump and psql must be at least as new as the server; Exponential finds such a client itself, and upgrade.ini [UpgradeSettings] PostgreSQLClientDir names one.
Clusters and replicas
A cluster on PostgreSQL uses the kernel's DFS backend for the file index, a primary with a streaming standby, and read replicas. See Clustering and DFS.
Common problems
- The setup wizard says the digest function is not available: create pgcrypto as above, then click Next again.
- Connection refused: check listen_addresses in postgresql.conf and the lines in pg_hba.conf.
- An extension's SQL fails only on PostgreSQL: MySQL syntax such as backtick quoting.