From 244b73d0f23407ef3f148025f96b90e7731106b3 Mon Sep 17 00:00:00 2001 From: Abhilash Raj Date: Mon, 19 Jun 2023 20:04:03 -0700 Subject: [PATCH] fix: Use -P pager=off in the psql commands. (#631) This allows for non-interactive use and doesn't hang on the user input in certain conditions, like when the command output is large. Fixes #610 --- core/docker-entrypoint.sh | 2 +- postorius/docker-entrypoint.sh | 2 +- web/docker-entrypoint.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/docker-entrypoint.sh b/core/docker-entrypoint.sh index 21f700c..254df08 100755 --- a/core/docker-entrypoint.sh +++ b/core/docker-entrypoint.sh @@ -6,7 +6,7 @@ function wait_for_postgres () { # moving forward. # TODO: Use python3's psycopg2 module to do this in python3 instead of # installing postgres-client in the image. - until psql $DATABASE_URL -c '\l'; do + until psql -P pager=off $DATABASE_URL -c '\l'; do >&2 echo "Postgres is unavailable - sleeping" sleep 1 done diff --git a/postorius/docker-entrypoint.sh b/postorius/docker-entrypoint.sh index 2b8218b..ec51cbb 100755 --- a/postorius/docker-entrypoint.sh +++ b/postorius/docker-entrypoint.sh @@ -7,7 +7,7 @@ function wait_for_postgres () { # moving forward. # TODO: Use python's psycopg2 module to do this in python instead of # installing postgres-client in the image. - until psql $DATABASE_URL -c '\l'; do + until psql -P pager=off $DATABASE_URL -c '\l'; do >&2 echo "Postgres is unavailable - sleeping" sleep 1 done diff --git a/web/docker-entrypoint.sh b/web/docker-entrypoint.sh index a29c396..09124c9 100755 --- a/web/docker-entrypoint.sh +++ b/web/docker-entrypoint.sh @@ -7,7 +7,7 @@ function wait_for_postgres () { # moving forward. # TODO: Use python's psycopg2 module to do this in python instead of # installing postgres-client in the image. - until psql $DATABASE_URL -c '\l'; do + until psql -P pager=off $DATABASE_URL -c '\l'; do >&2 echo "Postgres is unavailable - sleeping" sleep 1 done