Skip to content
This repository was archived by the owner on Jun 21, 2025. It is now read-only.

Add support for PostgreSQL 16 #39

Merged
merged 3 commits into from
Dec 21, 2023
Merged

Conversation

ledermann
Copy link
Contributor

@ledermann ledermann commented Sep 24, 2023

PostgreSQL 16 was released on 2023-09-14:
https://www.postgresql.org/about/news/postgresql-16-released-2715/

PostgreSQL 11 has reached end-of-life by 2023-11-09:
https://www.postgresql.org/support/versioning/

This PR enhances the build matrix (adding v16, removing v11), simplifies installing aws-cli (by using apk) and updates the README.

@IgorZvezdilin
Copy link

Hi guys! I believe that you approve this commit!

@mederic-p
Copy link

Hey, can we merge this?

@kije
Copy link

kije commented Oct 16, 2023

Also eagerly awaiting this :)

@eeshugerman any chance this Pr could get merged and the image published? 🚀

@eeshugerman
Copy link
Owner

Thanks @ledermann for the PR! Has anyone tested this out? Best I can tell Postgres v16 is not available in Alpine v3.18.

@ledermann
Copy link
Contributor Author

@eeshugerman Yes, it seems this PR is a bit premature - support for PostgreSQL 16 has not landed in Alpine 3.18:

$ docker run -it --rm alpine /bin/sh

/ # apk update
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/aarch64/APKINDEX.tar.gz
v3.18.4-82-gbad06ca2153 [https://dl-cdn.alpinelinux.org/alpine/v3.18/main]
v3.18.4-80-g1df2bca78e9 [https://dl-cdn.alpinelinux.org/alpine/v3.18/community]
OK: 19946 distinct packages available

/ # apk add postgresql-client
(1/8) Installing postgresql-common (1.2-r0)
Executing postgresql-common-1.2-r0.pre-install
(2/8) Installing lz4-libs (1.9.4-r4)
(3/8) Installing libpq (15.4-r0)
(4/8) Installing ncurses-terminfo-base (6.4_p20230506-r0)
(5/8) Installing libncursesw (6.4_p20230506-r0)
(6/8) Installing readline (8.2.1-r1)
(7/8) Installing zstd-libs (1.5.5-r4)
(8/8) Installing postgresql15-client (15.4-r0)
Executing busybox-1.36.1-r2.trigger
Executing postgresql-common-1.2-r0.trigger
* Setting postgresql15 as the default version
OK: 13 MiB in 23 packages

/ # apk add postgresql16-client
ERROR: unable to select packages:
  postgresql16-client (no such package):
    required by: world[postgresql16-client]

Currently, postgresql16-client is available in Edge only:
https://pkgs.alpinelinux.org/packages?name=postgresql16-client&branch=edge&repo=&arch=&maintainer=

I guess we'll have to wait a little longer.

This requires Alpine 3.19
@ledermann
Copy link
Contributor Author

In the meantime, Alpine 3.19 has been released with support for PostgreSQL 16, so this PR should be ready to merge.

@eeshugerman
Copy link
Owner

Any volunteers to test this?

@Ardakilic
Copy link

@eeshugerman I can try if that would help. I can try if a test version is tagged. I make a daily backup on a database on my docker compose and since v16 it has been stopped.

@eeshugerman
Copy link
Owner

Thanks @Ardakilic; I found some free time so went ahead and tested myself.

There is a minor snag:

#7 5.888 + pip3 install awscli
#7 7.026 error: externally-managed-environment
#7 7.026 
#7 7.026 × This environment is externally managed
#7 7.026 ╰─> 
#7 7.026     The system-wide python installation should be maintained using the system
#7 7.026     package manager (apk) only.
#7 7.026     
#7 7.026     If the package in question is not packaged already (and hence installable via
#7 7.026     "apk add py3-somepackage"), please consider installing it inside a virtual
#7 7.026     environment, e.g.:
#7 7.026     
#7 7.026     python3 -m venv /path/to/venv
#7 7.026     . /path/to/venv/bin/activate
#7 7.026     pip install mypackage
#7 7.026     
#7 7.026     To exit the virtual environment, run:
#7 7.026     
#7 7.026     deactivate
#7 7.026     
#7 7.026     The virtual environment is not deleted, and can be re-entered by re-sourcing
#7 7.026     the activate file.
#7 7.026     
#7 7.026     To automatically manage virtual environments, consider using pipx (from the
#7 7.026     pipx package).
#7 7.026 
#7 7.026 note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
#7 7.026 hint: See PEP 668 for the detailed specification.
#7 ERROR: process "/bin/sh -c sh install.sh && rm install.sh" did not complete successfully: exit code: 1

We can address this by switching from pip3 install awscli to apk add aws-cli in install.sh. This doesn't work on Alpine v3.10, which we use for Postgres v11, but that's fine -- we can drop Postgres v11 support.

@Ardakilic
Copy link

Ardakilic commented Dec 17, 2023

Since Postgres 11 users can still use the old tag, and v11 is EOL already, I'd personally go for it.

@muratoflu
Copy link

Hey folks, can we merge this =) ?

Copy link
Owner

@eeshugerman eeshugerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build fails -- see #39 (comment)

@Ardakilic
Copy link

This removes python3 and py3-pip as explicit dependencies.
Python is still installed as a derived dependency.

This fixes building on Alpine 3.19
@ledermann
Copy link
Contributor Author

Sorry, folks, for not testing my own PR. I have made the changes as requested. Now, the Docker image builds fine for Alpine from 3.12 to 3.19.

@eeshugerman
Copy link
Owner

Looks good, thanks @ledermann!

@eeshugerman eeshugerman merged commit bb9f3af into eeshugerman:master Dec 21, 2023
KTachibanaM pushed a commit to sekai-soft/postgres-backup-s3 that referenced this pull request Jun 1, 2025
* Add support for PostgreSQL 16

This requires Alpine 3.19

* Drop support for PostgreSQL 11

Version 11 has reached end-of-life (EOL)
https://www.postgresql.org/support/versioning/

* Install aws-cli via apk instead of pip3

This removes python3 and py3-pip as explicit dependencies.
Python is still installed as a derived dependency.

This fixes building on Alpine 3.19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants