From fa1c830f803ae02f90c430788dc91a7104291571 Mon Sep 17 00:00:00 2001 From: alexbelgium Date: Thu, 29 May 2025 15:39:59 +0200 Subject: [PATCH] update --- postgres/CHANGELOG.md | 2 -- postgres/build.json | 4 ++-- postgres/config.json | 3 ++- postgres/rootfs/etc/cont-init.d/99-run.sh | 18 ++++++++++++++++++ 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/postgres/CHANGELOG.md b/postgres/CHANGELOG.md index 431a3b68d..11fcd2c6a 100644 --- a/postgres/CHANGELOG.md +++ b/postgres/CHANGELOG.md @@ -1,5 +1,3 @@ -## 15.7-32 (29-05-2025) -- Use vectorchord0.4.1 + pgvectors0.3.0 (for migration) ## 15.7-31 (28-05-2025) - BREAKING CHANGE : please backup your database before updating diff --git a/postgres/build.json b/postgres/build.json index ccd128ebf..6405c0efe 100644 --- a/postgres/build.json +++ b/postgres/build.json @@ -1,7 +1,7 @@ { "build_from": { - "aarch64": "ghcr.io/immich-app/postgres:15-vectorchord0.4.1-pgvectors0.3.0", - "amd64": "ghcr.io/immich-app/postgres:15-vectorchord0.4.1-pgvectors0.3.0", + "aarch64": "ghcr.io/immich-app/postgres:15-vectorchord0.3.0-pgvectors0.3.0", + "amd64": "ghcr.io/immich-app/postgres:15-vectorchord0.3.0-pgvectors0.3.0", "armv7": "postgres:15-alpine" }, "codenotary": { diff --git a/postgres/config.json b/postgres/config.json index a6a9646f2..a4163a61c 100644 --- a/postgres/config.json +++ b/postgres/config.json @@ -11,6 +11,7 @@ "CONFIG_LOCATION": "/config/postgresql.conf", "PGDATA": "/config/database" }, + "hassio_api": true, "image": "ghcr.io/alexbelgium/postgres-{arch}", "init": false, "map": [ @@ -38,5 +39,5 @@ "slug": "postgres", "udev": true, "url": "https://github.com/alexbelgium/hassio-addons/tree/master/postgres", - "version": "15.7-29" + "version": "15.7-36" } diff --git a/postgres/rootfs/etc/cont-init.d/99-run.sh b/postgres/rootfs/etc/cont-init.d/99-run.sh index 39b700ad6..23c3e8db4 100755 --- a/postgres/rootfs/etc/cont-init.d/99-run.sh +++ b/postgres/rootfs/etc/cont-init.d/99-run.sh @@ -102,6 +102,23 @@ compare_versions() { return 1 } +show_db_extensions() { + bashio::log.info "==== PostgreSQL databases and enabled extensions ====" + for db in $(get_user_databases); do + bashio::log.info "Database: $db" + exts=$(psql "postgres://$DB_USERNAME:$DB_PASSWORD@$DB_HOSTNAME:$DB_PORT/$db" -tAc \ + "SELECT extname || ' (v' || extversion || ')' FROM pg_extension ORDER BY extname;") + if [ -n "$exts" ]; then + while read -r ext; do + [ -n "$ext" ] && bashio::log.info " - $ext" + done <<< "$exts" + else + bashio::log.info " (no extensions enabled)" + fi + done + bashio::log.info "==============================================" +} + # --------- Main logic ---------- upgrade_postgres_if_needed() { @@ -136,6 +153,7 @@ upgrade_postgres_if_needed() { wait_for_postgres else bashio::log.info "PostgreSQL data directory version ($CLUSTER_VERSION) matches image version ($IMAGE_VERSION)." + show_db_extensions fi }