Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pg_repack for Aurora PostgreSQL

Aurora PostgreSQL (pg15+) and pg_repack Compatibility

PostgreSQL major pg_repack versions
18 1.5.3
17 1.5.1, 1.5.2, 1.5.3
16 1.4.8, 1.5.0, 1.5.1, 1.5.2, 1.5.3
15 1.4.8, 1.5.0, 1.5.1, 1.5.2, 1.5.3

Tag format: Image tags use PostgreSQL-major-pg_repack-version (for example, 15-1.5.2). This repository builds all combinations listed in the table above.

Default version rule: The default PG_REPACK_VERSION value in each PostgreSQL-major Dockerfile is set to the latest supported pg_repack version for that major.

AuroraPostgreSQL.Extensions

Build

List supported combinations:

make list

Build all supported combinations locally:

make build-all

Build one specific combination:

make build-15-1.5.3

or

make build-one COMBO=15-1.5.3

To use a different local image name prefix:

make build-15-1.5.3 IMAGE=my-pg-repack

Aurora Setup

Enable the extension in the target database:

CREATE EXTENSION IF NOT EXISTS pg_repack;

Check the installed extension version:

SELECT extname, extversion
FROM pg_extension
WHERE extname = 'pg_repack';

Check available pg_repack versions on the Aurora instance:

SELECT name, default_version, installed_version
FROM pg_available_extensions
WHERE name = 'pg_repack';

Usage

Repack one table on Aurora PostgreSQL:

docker run --rm \
  -e PGHOST=my-aurora.cluster-xxxxxxxxxxxx.ap-northeast-1.rds.amazonaws.com \
  -e PGPORT=5432 \
  -e PGDATABASE=app_db \
  -e PGUSER=repack_user \
  -e PGPASSWORD=your_password \
  -e PGSSLMODE=require \
  ghcr.io/higanworks/docker-pg_repack:15-1.5.3 \
  --table public.orders \
  --jobs 4 \
  --no-superuser-check

Repack one table with exported environment variables:

export PGHOST=my-aurora.cluster-xxxxxxxxxxxx.ap-northeast-1.rds.amazonaws.com
export PGPORT=5432
export PGDATABASE=app_db
export PGUSER=repack_user
export PGPASSWORD=your_password
export PGSSLMODE=require

docker run --rm \
  -e PGHOST \
  -e PGPORT \
  -e PGDATABASE \
  -e PGUSER \
  -e PGPASSWORD \
  -e PGSSLMODE \
  ghcr.io/higanworks/docker-pg_repack:15-1.5.3 \
  --table public.orders \
  --jobs 4 \
  --no-superuser-check

Repack all tables in the target database:

docker run --rm \
  -e PGHOST=my-aurora.cluster-xxxxxxxxxxxx.ap-northeast-1.rds.amazonaws.com \
  -e PGPORT=5432 \
  -e PGDATABASE=app_db \
  -e PGUSER=repack_user \
  -e PGPASSWORD=your_password \
  -e PGSSLMODE=require \
  ghcr.io/higanworks/docker-pg_repack:15-1.5.3 \
  --jobs 4 \
  --no-superuser-check

Note On Aurora PostgreSQL, --all does not work as expected. It can include system-managed objects (for example, rdsadmin), so use explicit table targeting or database-scoped runs without --all.

About

Aurora PostgreSQL-compatible pg_repack Docker images across multiple PostgreSQL major versions, built and published to GHCR.

Resources

Stars

Watchers

Forks

Packages

Contributors

Languages