Skip to content

Commit

Permalink
feat: Upgrades to pg_repack 1.4.8 (supports pg15) (#6)
Browse files Browse the repository at this point in the history
* feat: Upgrades to pg_repack 1.4.8 (supports pg15)
  • Loading branch information
hartmut-co-uk authored Nov 6, 2022
1 parent 406b0a1 commit 26a0403
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM postgres:14
FROM postgres:15

RUN apt-get update --fix-missing && \
apt-get install -y postgresql-server-dev-$PG_MAJOR wget openssh-server
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This images follows the pg_repack releases + compatibility with PostgreSQL.
| 12 | 1.4.5 |
| 13 | 1.4.6 |
| 14 | 1.4.7 |
| 15 | 1.4.8 |


## Dockerhub
Expand All @@ -32,10 +33,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. pg11 (+pg_repack 1.4.4):
e.g. pg15 (+pg_repack 1.4.8):

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

psql from local:
Expand All @@ -45,14 +46,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.4 psql -h localhost -U postgres
docker run -e PGPASSWORD=supersecure -it --rm --network host hartmutcouk/pg-repack-docker:1.4.8 psql -h localhost -U postgres
```


### exec pg_repack against host network

```
docker run -e PGPASSWORD=supersecure -it --rm --network host hartmutcouk/pg-repack-docker:1.4.4 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.4.7 pg_repack -h localhost -U dbroot --dbname=dbname --dry-run --table=table1 --only-indexes --no-superuser-check
```

Notes:
Expand Down
6 changes: 3 additions & 3 deletions scripts/install_pg_repack.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash

apt-get install -y make unzip gcc libssl-dev zlib1g-dev liblz4-dev libreadline-dev
wget -q -O pg_repack.zip "https://api.pgxn.org/dist/pg_repack/1.4.7/pg_repack-1.4.7.zip"
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"
unzip pg_repack.zip && rm pg_repack.zip
cd pg_repack-*
make && make install
cd ..
rm -rf pg_repack-*
apt-get remove --auto-remove -y make unzip gcc libssl-dev zlib1g-dev libreadline-dev
apt-get remove --auto-remove -y make unzip gcc libssl-dev zlib1g-dev libreadline-dev libzstd-dev

0 comments on commit 26a0403

Please sign in to comment.