Docker image with PostgreSQL 17 and pg_ivm (Incremental View Maintenance) extension.
117
A ready-to-use Docker image of PostgreSQL with the pg_ivm (Incremental View Maintenance) extension pre-installed.
pg_ivm (v1.11) - Incremental View Maintenanceclang-19 and hardened compilation flagsdocker run -d --name postgres-ivm \
-e POSTGRES_PASSWORD=yoursecurepassword \
-p 5432:5432 \
-v pgdata:/var/lib/postgresql/data \
yourusername/postgres-pgivm:17-alpine3.22
version: '3.8'
services:
postgres:
image: yourusername/postgres-pgivm:17-alpine3.22
environment:
POSTGRES_PASSWORD: yoursecurepassword
POSTGRES_USER: customuser
POSTGRES_DB: mydatabase
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
volumes:
pgdata:
After starting your container:
-- Enable the extension
CREATE EXTENSION pg_ivm;
-- Create an incremental materialized view
CREATE INCREMENTAL MATERIALIZED VIEW sales_summary AS
SELECT product_id, SUM(quantity) AS total_quantity, SUM(price) AS total_sales
FROM sales
GROUP BY product_id;
-- The view automatically maintains itself as data changes
INSERT INTO sales VALUES (1, 5, 19.99);
-- View stays updated without manual REFRESH
To build with different PostgreSQL versions or customize extensions:
git clone https://github.com/yourusername/postgres-pgivm.git
cd postgres-pgivm
# Build with default options
docker build -t custom-postgres-pgivm .
# Build with different PostgreSQL version
docker build --build-arg PG_VERSION=15 -t custom-postgres-pgivm:15 .
We welcome contributions! Here's how you can help:
# 1. Fork and clone the repository
git clone https://github.com/koushikeng/postgres-pgivm.git
# 2. Install pre-commit hooks
pre-commit install
# 3. Build test image
docker build -t test-pgivm .
# 4. Run tests
./test/test_extension.sh
PostgreSQL License (same as PostgreSQL itself)
Clear Contribution Guidelines:
Project Badges:
Comprehensive Documentation:
Modular Structure:
Testing Information:
Content type
Image
Digest
sha256:d460de9cf…
Size
438.6 MB
Last updated
over 1 year ago
docker pull koushikghosh86/postgres-pgivm:17-alpine3.22