Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update postgres #16000

Merged
merged 1 commit into from
Jan 5, 2024
Merged

Conversation

tianon
Copy link
Member

@tianon tianon commented Jan 4, 2024

Changes:

Changes:

- docker-library/postgres@aa542a0: Merge pull request docker-library/postgres#1179 from infosiftr/less
- docker-library/postgres@d416768: Add `less` to Debian variants
- docker-library/postgres@ce5bf6e: Merge pull request docker-library/postgres#1166 from infosiftr/unlimited-passwords
Copy link

github-actions bot commented Jan 4, 2024

Diff for 48ca8c2:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index a7208d3..10b0631 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -3,100 +3,100 @@ GitRepo: https://github.com/docker-library/postgres.git
 
 Tags: 12.17, 12, 12.17-bookworm, 12-bookworm
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: c86568af4a6861cb30b8f1b736b0868a3129bdd6
+GitCommit: d416768b1a7f03919b9cf0fef6adc9dcad937888
 Directory: 12/bookworm
 
 Tags: 12.17-alpine3.18, 12-alpine3.18
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 31aed10dbe490c13e5ca889897ee01ef3e1b91e2
+GitCommit: ce5bf6e7eb8f339b2a8561bf8fb5fe5d4e8c96aa
 Directory: 12/alpine3.18
 
 Tags: 12.17-alpine3.19, 12-alpine3.19, 12.17-alpine, 12-alpine
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 31aed10dbe490c13e5ca889897ee01ef3e1b91e2
+GitCommit: ce5bf6e7eb8f339b2a8561bf8fb5fe5d4e8c96aa
 Directory: 12/alpine3.19
 
 Tags: 12.17-bullseye, 12-bullseye
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: c86568af4a6861cb30b8f1b736b0868a3129bdd6
+GitCommit: d416768b1a7f03919b9cf0fef6adc9dcad937888
 Directory: 12/bullseye
 
 Tags: 13.13, 13, 13.13-bookworm, 13-bookworm
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: c86568af4a6861cb30b8f1b736b0868a3129bdd6
+GitCommit: d416768b1a7f03919b9cf0fef6adc9dcad937888
 Directory: 13/bookworm
 
 Tags: 13.13-alpine3.18, 13-alpine3.18
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 31aed10dbe490c13e5ca889897ee01ef3e1b91e2
+GitCommit: ce5bf6e7eb8f339b2a8561bf8fb5fe5d4e8c96aa
 Directory: 13/alpine3.18
 
 Tags: 13.13-alpine3.19, 13-alpine3.19, 13.13-alpine, 13-alpine
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 31aed10dbe490c13e5ca889897ee01ef3e1b91e2
+GitCommit: ce5bf6e7eb8f339b2a8561bf8fb5fe5d4e8c96aa
 Directory: 13/alpine3.19
 
 Tags: 13.13-bullseye, 13-bullseye
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: c86568af4a6861cb30b8f1b736b0868a3129bdd6
+GitCommit: d416768b1a7f03919b9cf0fef6adc9dcad937888
 Directory: 13/bullseye
 
 Tags: 14.10, 14, 14.10-bookworm, 14-bookworm
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: c86568af4a6861cb30b8f1b736b0868a3129bdd6
+GitCommit: d416768b1a7f03919b9cf0fef6adc9dcad937888
 Directory: 14/bookworm
 
 Tags: 14.10-alpine3.18, 14-alpine3.18
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 31aed10dbe490c13e5ca889897ee01ef3e1b91e2
+GitCommit: ce5bf6e7eb8f339b2a8561bf8fb5fe5d4e8c96aa
 Directory: 14/alpine3.18
 
 Tags: 14.10-alpine3.19, 14-alpine3.19, 14.10-alpine, 14-alpine
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 31aed10dbe490c13e5ca889897ee01ef3e1b91e2
+GitCommit: ce5bf6e7eb8f339b2a8561bf8fb5fe5d4e8c96aa
 Directory: 14/alpine3.19
 
 Tags: 14.10-bullseye, 14-bullseye
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: c86568af4a6861cb30b8f1b736b0868a3129bdd6
+GitCommit: d416768b1a7f03919b9cf0fef6adc9dcad937888
 Directory: 14/bullseye
 
 Tags: 15.5, 15, 15.5-bookworm, 15-bookworm
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: c86568af4a6861cb30b8f1b736b0868a3129bdd6
+GitCommit: d416768b1a7f03919b9cf0fef6adc9dcad937888
 Directory: 15/bookworm
 
 Tags: 15.5-alpine3.18, 15-alpine3.18
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 31aed10dbe490c13e5ca889897ee01ef3e1b91e2
+GitCommit: ce5bf6e7eb8f339b2a8561bf8fb5fe5d4e8c96aa
 Directory: 15/alpine3.18
 
 Tags: 15.5-alpine3.19, 15-alpine3.19, 15.5-alpine, 15-alpine
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 31aed10dbe490c13e5ca889897ee01ef3e1b91e2
+GitCommit: ce5bf6e7eb8f339b2a8561bf8fb5fe5d4e8c96aa
 Directory: 15/alpine3.19
 
 Tags: 15.5-bullseye, 15-bullseye
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: c86568af4a6861cb30b8f1b736b0868a3129bdd6
+GitCommit: d416768b1a7f03919b9cf0fef6adc9dcad937888
 Directory: 15/bullseye
 
 Tags: 16.1, 16, latest, 16.1-bookworm, 16-bookworm, bookworm
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: c86568af4a6861cb30b8f1b736b0868a3129bdd6
+GitCommit: d416768b1a7f03919b9cf0fef6adc9dcad937888
 Directory: 16/bookworm
 
 Tags: 16.1-alpine3.18, 16-alpine3.18, alpine3.18
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 31aed10dbe490c13e5ca889897ee01ef3e1b91e2
+GitCommit: ce5bf6e7eb8f339b2a8561bf8fb5fe5d4e8c96aa
 Directory: 16/alpine3.18
 
 Tags: 16.1-alpine3.19, 16-alpine3.19, alpine3.19, 16.1-alpine, 16-alpine, alpine
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 31aed10dbe490c13e5ca889897ee01ef3e1b91e2
+GitCommit: ce5bf6e7eb8f339b2a8561bf8fb5fe5d4e8c96aa
 Directory: 16/alpine3.19
 
 Tags: 16.1-bullseye, 16-bullseye, bullseye
 Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: c86568af4a6861cb30b8f1b736b0868a3129bdd6
+GitCommit: d416768b1a7f03919b9cf0fef6adc9dcad937888
 Directory: 16/bullseye
diff --git a/postgres_12-alpine/docker-entrypoint.sh b/postgres_12-alpine/docker-entrypoint.sh
index 151d75e..8163d10 100755
--- a/postgres_12-alpine/docker-entrypoint.sh
+++ b/postgres_12-alpine/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'
diff --git a/postgres_12-alpine3.18/docker-entrypoint.sh b/postgres_12-alpine3.18/docker-entrypoint.sh
index 151d75e..8163d10 100755
--- a/postgres_12-alpine3.18/docker-entrypoint.sh
+++ b/postgres_12-alpine3.18/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'
diff --git a/postgres_12-bookworm/Dockerfile b/postgres_12-bookworm/Dockerfile
index 647dc8d..20968d7 100644
--- a/postgres_12-bookworm/Dockerfile
+++ b/postgres_12-bookworm/Dockerfile
@@ -20,6 +20,10 @@ RUN set -ex; \
 	apt-get update; \
 	apt-get install -y --no-install-recommends \
 		gnupg \
+# https://www.postgresql.org/docs/16/app-psql.html#APP-PSQL-META-COMMAND-PSET-PAGER
+# https://github.com/postgres/postgres/blob/REL_16_1/src/include/fe_utils/print.h#L25
+# (if "less" is available, it gets used as the default pager for psql, and it only adds ~1.5MiB to our image size)
+		less \
 	; \
 	rm -rf /var/lib/apt/lists/*
 
diff --git a/postgres_12-bookworm/docker-entrypoint.sh b/postgres_12-bookworm/docker-entrypoint.sh
index 6d197bc..6f59993 100755
--- a/postgres_12-bookworm/docker-entrypoint.sh
+++ b/postgres_12-bookworm/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'
diff --git a/postgres_12-bullseye/Dockerfile b/postgres_12-bullseye/Dockerfile
index 8238633..d311e72 100644
--- a/postgres_12-bullseye/Dockerfile
+++ b/postgres_12-bullseye/Dockerfile
@@ -20,6 +20,10 @@ RUN set -ex; \
 	apt-get update; \
 	apt-get install -y --no-install-recommends \
 		gnupg \
+# https://www.postgresql.org/docs/16/app-psql.html#APP-PSQL-META-COMMAND-PSET-PAGER
+# https://github.com/postgres/postgres/blob/REL_16_1/src/include/fe_utils/print.h#L25
+# (if "less" is available, it gets used as the default pager for psql, and it only adds ~1.5MiB to our image size)
+		less \
 	; \
 	rm -rf /var/lib/apt/lists/*
 
diff --git a/postgres_12-bullseye/docker-entrypoint.sh b/postgres_12-bullseye/docker-entrypoint.sh
index 6d197bc..6f59993 100755
--- a/postgres_12-bullseye/docker-entrypoint.sh
+++ b/postgres_12-bullseye/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'
diff --git a/postgres_13-alpine/docker-entrypoint.sh b/postgres_13-alpine/docker-entrypoint.sh
index 151d75e..8163d10 100755
--- a/postgres_13-alpine/docker-entrypoint.sh
+++ b/postgres_13-alpine/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'
diff --git a/postgres_13-alpine3.18/docker-entrypoint.sh b/postgres_13-alpine3.18/docker-entrypoint.sh
index 151d75e..8163d10 100755
--- a/postgres_13-alpine3.18/docker-entrypoint.sh
+++ b/postgres_13-alpine3.18/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'
diff --git a/postgres_13-bookworm/Dockerfile b/postgres_13-bookworm/Dockerfile
index 1086785..a98e9c3 100644
--- a/postgres_13-bookworm/Dockerfile
+++ b/postgres_13-bookworm/Dockerfile
@@ -20,6 +20,10 @@ RUN set -ex; \
 	apt-get update; \
 	apt-get install -y --no-install-recommends \
 		gnupg \
+# https://www.postgresql.org/docs/16/app-psql.html#APP-PSQL-META-COMMAND-PSET-PAGER
+# https://github.com/postgres/postgres/blob/REL_16_1/src/include/fe_utils/print.h#L25
+# (if "less" is available, it gets used as the default pager for psql, and it only adds ~1.5MiB to our image size)
+		less \
 	; \
 	rm -rf /var/lib/apt/lists/*
 
diff --git a/postgres_13-bookworm/docker-entrypoint.sh b/postgres_13-bookworm/docker-entrypoint.sh
index 6d197bc..6f59993 100755
--- a/postgres_13-bookworm/docker-entrypoint.sh
+++ b/postgres_13-bookworm/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'
diff --git a/postgres_13-bullseye/Dockerfile b/postgres_13-bullseye/Dockerfile
index 0f2b30c..a4374df 100644
--- a/postgres_13-bullseye/Dockerfile
+++ b/postgres_13-bullseye/Dockerfile
@@ -20,6 +20,10 @@ RUN set -ex; \
 	apt-get update; \
 	apt-get install -y --no-install-recommends \
 		gnupg \
+# https://www.postgresql.org/docs/16/app-psql.html#APP-PSQL-META-COMMAND-PSET-PAGER
+# https://github.com/postgres/postgres/blob/REL_16_1/src/include/fe_utils/print.h#L25
+# (if "less" is available, it gets used as the default pager for psql, and it only adds ~1.5MiB to our image size)
+		less \
 	; \
 	rm -rf /var/lib/apt/lists/*
 
diff --git a/postgres_13-bullseye/docker-entrypoint.sh b/postgres_13-bullseye/docker-entrypoint.sh
index 6d197bc..6f59993 100755
--- a/postgres_13-bullseye/docker-entrypoint.sh
+++ b/postgres_13-bullseye/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'
diff --git a/postgres_14-alpine/docker-entrypoint.sh b/postgres_14-alpine/docker-entrypoint.sh
index 151d75e..8163d10 100755
--- a/postgres_14-alpine/docker-entrypoint.sh
+++ b/postgres_14-alpine/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'
diff --git a/postgres_14-alpine3.18/docker-entrypoint.sh b/postgres_14-alpine3.18/docker-entrypoint.sh
index 151d75e..8163d10 100755
--- a/postgres_14-alpine3.18/docker-entrypoint.sh
+++ b/postgres_14-alpine3.18/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'
diff --git a/postgres_14-bookworm/Dockerfile b/postgres_14-bookworm/Dockerfile
index 4905043..096e32d 100644
--- a/postgres_14-bookworm/Dockerfile
+++ b/postgres_14-bookworm/Dockerfile
@@ -20,6 +20,10 @@ RUN set -ex; \
 	apt-get update; \
 	apt-get install -y --no-install-recommends \
 		gnupg \
+# https://www.postgresql.org/docs/16/app-psql.html#APP-PSQL-META-COMMAND-PSET-PAGER
+# https://github.com/postgres/postgres/blob/REL_16_1/src/include/fe_utils/print.h#L25
+# (if "less" is available, it gets used as the default pager for psql, and it only adds ~1.5MiB to our image size)
+		less \
 	; \
 	rm -rf /var/lib/apt/lists/*
 
diff --git a/postgres_14-bookworm/docker-entrypoint.sh b/postgres_14-bookworm/docker-entrypoint.sh
index 6d197bc..6f59993 100755
--- a/postgres_14-bookworm/docker-entrypoint.sh
+++ b/postgres_14-bookworm/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'
diff --git a/postgres_14-bullseye/Dockerfile b/postgres_14-bullseye/Dockerfile
index 95e24e4..e507624 100644
--- a/postgres_14-bullseye/Dockerfile
+++ b/postgres_14-bullseye/Dockerfile
@@ -20,6 +20,10 @@ RUN set -ex; \
 	apt-get update; \
 	apt-get install -y --no-install-recommends \
 		gnupg \
+# https://www.postgresql.org/docs/16/app-psql.html#APP-PSQL-META-COMMAND-PSET-PAGER
+# https://github.com/postgres/postgres/blob/REL_16_1/src/include/fe_utils/print.h#L25
+# (if "less" is available, it gets used as the default pager for psql, and it only adds ~1.5MiB to our image size)
+		less \
 	; \
 	rm -rf /var/lib/apt/lists/*
 
diff --git a/postgres_14-bullseye/docker-entrypoint.sh b/postgres_14-bullseye/docker-entrypoint.sh
index 6d197bc..6f59993 100755
--- a/postgres_14-bullseye/docker-entrypoint.sh
+++ b/postgres_14-bullseye/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'
diff --git a/postgres_15-alpine/docker-entrypoint.sh b/postgres_15-alpine/docker-entrypoint.sh
index 151d75e..8163d10 100755
--- a/postgres_15-alpine/docker-entrypoint.sh
+++ b/postgres_15-alpine/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'
diff --git a/postgres_15-alpine3.18/docker-entrypoint.sh b/postgres_15-alpine3.18/docker-entrypoint.sh
index 151d75e..8163d10 100755
--- a/postgres_15-alpine3.18/docker-entrypoint.sh
+++ b/postgres_15-alpine3.18/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'
diff --git a/postgres_15-bookworm/Dockerfile b/postgres_15-bookworm/Dockerfile
index af0da3d..f05387d 100644
--- a/postgres_15-bookworm/Dockerfile
+++ b/postgres_15-bookworm/Dockerfile
@@ -20,6 +20,10 @@ RUN set -ex; \
 	apt-get update; \
 	apt-get install -y --no-install-recommends \
 		gnupg \
+# https://www.postgresql.org/docs/16/app-psql.html#APP-PSQL-META-COMMAND-PSET-PAGER
+# https://github.com/postgres/postgres/blob/REL_16_1/src/include/fe_utils/print.h#L25
+# (if "less" is available, it gets used as the default pager for psql, and it only adds ~1.5MiB to our image size)
+		less \
 	; \
 	rm -rf /var/lib/apt/lists/*
 
diff --git a/postgres_15-bookworm/docker-entrypoint.sh b/postgres_15-bookworm/docker-entrypoint.sh
index 6d197bc..6f59993 100755
--- a/postgres_15-bookworm/docker-entrypoint.sh
+++ b/postgres_15-bookworm/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'
diff --git a/postgres_15-bullseye/Dockerfile b/postgres_15-bullseye/Dockerfile
index 2d9db9b..b091bc4 100644
--- a/postgres_15-bullseye/Dockerfile
+++ b/postgres_15-bullseye/Dockerfile
@@ -20,6 +20,10 @@ RUN set -ex; \
 	apt-get update; \
 	apt-get install -y --no-install-recommends \
 		gnupg \
+# https://www.postgresql.org/docs/16/app-psql.html#APP-PSQL-META-COMMAND-PSET-PAGER
+# https://github.com/postgres/postgres/blob/REL_16_1/src/include/fe_utils/print.h#L25
+# (if "less" is available, it gets used as the default pager for psql, and it only adds ~1.5MiB to our image size)
+		less \
 	; \
 	rm -rf /var/lib/apt/lists/*
 
diff --git a/postgres_15-bullseye/docker-entrypoint.sh b/postgres_15-bullseye/docker-entrypoint.sh
index 6d197bc..6f59993 100755
--- a/postgres_15-bullseye/docker-entrypoint.sh
+++ b/postgres_15-bullseye/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'
diff --git a/postgres_alpine/docker-entrypoint.sh b/postgres_alpine/docker-entrypoint.sh
index 151d75e..8163d10 100755
--- a/postgres_alpine/docker-entrypoint.sh
+++ b/postgres_alpine/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'
diff --git a/postgres_alpine3.18/docker-entrypoint.sh b/postgres_alpine3.18/docker-entrypoint.sh
index 151d75e..8163d10 100755
--- a/postgres_alpine3.18/docker-entrypoint.sh
+++ b/postgres_alpine3.18/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'
diff --git a/postgres_bookworm/Dockerfile b/postgres_bookworm/Dockerfile
index 15369fd..a2bde2b 100644
--- a/postgres_bookworm/Dockerfile
+++ b/postgres_bookworm/Dockerfile
@@ -20,6 +20,10 @@ RUN set -ex; \
 	apt-get update; \
 	apt-get install -y --no-install-recommends \
 		gnupg \
+# https://www.postgresql.org/docs/16/app-psql.html#APP-PSQL-META-COMMAND-PSET-PAGER
+# https://github.com/postgres/postgres/blob/REL_16_1/src/include/fe_utils/print.h#L25
+# (if "less" is available, it gets used as the default pager for psql, and it only adds ~1.5MiB to our image size)
+		less \
 	; \
 	rm -rf /var/lib/apt/lists/*
 
diff --git a/postgres_bookworm/docker-entrypoint.sh b/postgres_bookworm/docker-entrypoint.sh
index 6d197bc..6f59993 100755
--- a/postgres_bookworm/docker-entrypoint.sh
+++ b/postgres_bookworm/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'
diff --git a/postgres_bullseye/Dockerfile b/postgres_bullseye/Dockerfile
index b132cc2..5d0cd70 100644
--- a/postgres_bullseye/Dockerfile
+++ b/postgres_bullseye/Dockerfile
@@ -20,6 +20,10 @@ RUN set -ex; \
 	apt-get update; \
 	apt-get install -y --no-install-recommends \
 		gnupg \
+# https://www.postgresql.org/docs/16/app-psql.html#APP-PSQL-META-COMMAND-PSET-PAGER
+# https://github.com/postgres/postgres/blob/REL_16_1/src/include/fe_utils/print.h#L25
+# (if "less" is available, it gets used as the default pager for psql, and it only adds ~1.5MiB to our image size)
+		less \
 	; \
 	rm -rf /var/lib/apt/lists/*
 
diff --git a/postgres_bullseye/docker-entrypoint.sh b/postgres_bullseye/docker-entrypoint.sh
index 6d197bc..6f59993 100755
--- a/postgres_bullseye/docker-entrypoint.sh
+++ b/postgres_bullseye/docker-entrypoint.sh
@@ -103,6 +103,8 @@ docker_init_database_dir() {
 # print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
 # assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
 docker_verify_minimum_env() {
+	case "${PG_MAJOR:-}" in
+		12 | 13) # https://github.com/postgres/postgres/commit/67a472d71c98c3d2fa322a1b4013080b20720b98
 			# check password first so we can output the warning before postgres
 			# messes it up
 			if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
@@ -117,6 +119,8 @@ docker_verify_minimum_env() {
 
 				EOWARN
 			fi
+			;;
+	esac
 	if [ -z "$POSTGRES_PASSWORD" ] && [ 'trust' != "$POSTGRES_HOST_AUTH_METHOD" ]; then
 		# The - option suppresses leading tabs but *not* spaces. :)
 		cat >&2 <<-'EOE'

Relevant Maintainers:

@yosifkit yosifkit merged commit ca21d5d into docker-library:master Jan 5, 2024
25 checks passed
@yosifkit yosifkit deleted the postgres branch January 5, 2024 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants