PostgreSQL Version Matrix
Odoo exclusively uses PostgreSQL as its database. Each Odoo version has minimum and recommended PostgreSQL version requirements. Using the wrong PostgreSQL version can cause query failures, missing features, or performance issues.
| Odoo Version | Minimum PostgreSQL | Recommended | Notes |
|---|---|---|---|
| 14.0 | 10 | 12-13 | PG 10 is EOL |
| 15.0 | 10 | 13-14 | |
| 16.0 | 12 | 14-15 | Dropped PG 10/11 |
| 17.0 | 12 | 14-16 | |
| 18.0 | 14 | 15-16 | Dropped PG 12/13 |
| 19.0 | 14 | 16 | 16+ needed for pgvector AI |
pgvector for Odoo 19 AI
Odoo 19's AI suite requires the pgvector PostgreSQL extension for vector embeddings and similarity search (RAG). pgvector works best on PostgreSQL 16+ and requires manual installation:
# Install pgvector on Ubuntu:
sudo apt install postgresql-16-pgvector
# Or compile from source:
git clone https://github.com/pgvector/pgvector.git
cd pgvector
make
sudo make install
# Enable in database:
CREATE EXTENSION vector;Without pgvector, Odoo 19 works normally but the AI features (ai module and all ai_* bridges) will not install.
Performance Configuration
Default PostgreSQL settings are not optimized for Odoo. Key parameters to tune:
# postgresql.conf recommendations for Odoo:
shared_buffers = 2GB # 25% of RAM
effective_cache_size = 6GB # 75% of RAM
work_mem = 64MB # For complex queries
maintenance_work_mem = 512MB # For VACUUM, index builds
wal_buffers = 64MB
checkpoint_completion_target = 0.9
random_page_cost = 1.1 # For SSD storage
effective_io_concurrency = 200 # For SSD storage
max_connections = 200 # Match Odoo workers * 2Connection Pooling
For production Odoo deployments with multiple workers, use connection pooling to manage PostgreSQL connections efficiently. Odoo's --db_maxconn parameter limits connections per worker. PgBouncer is recommended for high-concurrency deployments.
Backup and Recovery
PostgreSQL backup strategies for Odoo:
pg_dump— logical backup, portable, slower for large databasespg_basebackup— physical backup, fast, requires same PG version- WAL archiving — continuous backup with point-in-time recovery
Upgrading PostgreSQL
When upgrading PostgreSQL alongside Odoo:
- Backup the database with pg_dump
- Install the new PostgreSQL version
- Restore the backup into the new cluster
- Install required extensions (pgvector for v19)
- Update Odoo configuration to point to new cluster
DeployMonkey Advantage
DeployMonkey manages PostgreSQL configuration, tuning, and pgvector installation automatically. Every deployment gets optimized database settings for your instance size and workload.