Skip to content

Commit

Permalink
feat: Upgrades to pg_repack 1.5.0 (supports pg16) (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
hartmut-co-uk authored Dec 17, 2023
1 parent 26a0403 commit 632058a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM postgres:15
FROM postgres:16

RUN apt-get update --fix-missing && \
apt-get install -y postgresql-server-dev-$PG_MAJOR wget openssh-server
Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ This images follows the pg_repack releases + compatibility with PostgreSQL.

| postgres | pg_repack |
|----------|-----------|
| 10 | 1.4.3 |
| 11 | 1.4.4 |
| 12 | 1.4.5 |
| 13 | 1.4.6 |
| 14 | 1.4.7 |
| 16 | 1.5.0 |
| 15 | 1.4.8 |
| 14 | 1.4.7 |
| 13 | 1.4.6 |
| 12 | 1.4.5 |
| 11 | 1.4.4 |
| 10 | 1.4.3 |


## Dockerhub
Expand All @@ -33,10 +34,10 @@ docker build . -t pg-repack-docker
### run postgres

This image extends the official [postgres docker image](https://hub.docker.com/_/postgres/) - so you can start a container with postgres following the official image.
e.g. pg15 (+pg_repack 1.4.8):
e.g. pg16 (+pg_repack 1.5.0):

```
docker run -e POSTGRES_PASSWORD=1234 --name pg15 -p 5432:5432 -d hartmutcouk/pg-repack-docker:1.4.8
docker run -e POSTGRES_PASSWORD=1234 --name pg16 -p 5432:5432 -d hartmutcouk/pg-repack-docker:1.5.0
```

psql from local:
Expand All @@ -46,14 +47,14 @@ PGPASSWORD=supersecure psql -h localhost -U postgres

psql via docker:
```
docker run -e PGPASSWORD=supersecure -it --rm --network host hartmutcouk/pg-repack-docker:1.4.8 psql -h localhost -U postgres
docker run -e PGPASSWORD=supersecure -it --rm --network host hartmutcouk/pg-repack-docker:1.5.0 psql -h localhost -U postgres
```


### exec pg_repack against host network

```
docker run -e PGPASSWORD=1234 -it --rm --network host hartmutcouk/pg-repack-docker:1.4.7 pg_repack -h localhost -U dbroot --dbname=dbname --dry-run --table=table1 --only-indexes --no-superuser-check
docker run -e PGPASSWORD=1234 -it --rm --network host hartmutcouk/pg-repack-docker:1.5.0 pg_repack -h localhost -U dbroot --dbname=dbname --dry-run --table=table1 --only-indexes --no-superuser-check
```

Notes:
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_pg_repack.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

apt-get install -y make unzip gcc libssl-dev zlib1g-dev liblz4-dev libreadline-dev libzstd-dev
wget -q -O pg_repack.zip "https://api.pgxn.org/dist/pg_repack/1.4.8/pg_repack-1.4.8.zip"
wget -q -O pg_repack.zip "https://api.pgxn.org/dist/pg_repack/1.5.0/pg_repack-1.5.0.zip"
unzip pg_repack.zip && rm pg_repack.zip
cd pg_repack-*
make && make install
Expand Down

0 comments on commit 632058a

Please # to comment.