Skip to content

Commit edcae01

Browse files
Address first set of review
1 parent 89cddda commit edcae01

4 files changed

Lines changed: 5 additions & 8 deletions

File tree

postgres/bin/entrypoint.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@ wait_for_db() {
1010

1111
echo "Waiting for PostgreSQL server to be ready..."
1212
until psql "$DATABASE_URL" -c '\q' 2>/dev/null || [ "$retries" -eq 0 ]; do
13-
echo "PostgreSQL is unavailable - sleeping ($((retries--)) retries left)..."
13+
echo "PostgreSQL is unavailable - ($((retries--)) retries left)..."
1414
sleep "$sleep_time"
1515
done
1616

1717
if [ "$retries" -eq 0 ]; then
18-
echo "ERROR: PostgreSQL server did not become ready in time."
18+
echo "ERROR: PostgreSQL server did not respond."
1919
exit 1
2020
fi
21-
22-
echo "PostgreSQL server is ready!"
2321
}
2422

2523
if [ -z "${DATABASE_URL:-""}" ]; then

postgres/bin/load-from-s3.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ fi
2020
PG_RESTORE="pg_restore-$SERVER_VERSION"
2121

2222
if ! command -v "$PG_RESTORE" &>/dev/null; then
23-
echo "Warning: pg_restore for version $SERVER_VERSION is not installed. Defaulting to pg_restore-17."
24-
PG_RESTORE="pg_restore-17"
23+
echo "Error: $PG_RESTORE not found in PATH." >&2
24+
exit 1
2525
fi
2626

2727
echo "Dropping all objects owned by \"$USER\" in the database..."

postgres/bin/parse_database_url.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python3
22
"""Dump out a DATABASE_URL provided in the environment as individual variables"""
33
import os
4-
import sys
54
from urllib.parse import urlparse
65

76
parsed = urlparse(os.environ["DATABASE_URL"])

postgres/docs/support-newer-postgres-versions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
and running the script against a PostgreSQL 18 server.
1010
3. Ensure fallback compatibility:
1111
Test the script with no `SERVER_VERSION` set to confirm it falls back to the latest version.
12-
4. Update `dump-to-s3.sh` script's `SERVER_VERSION` default value if the new version becomes the default:
12+
4. Update `load-from-s3.sh` & `dump-to-s3.sh` script's `SERVER_VERSION` default value if the new version becomes the default:
1313
Change `SERVER_VERSION=${SERVER_VERSION:-17}` to `SERVER_VERSION=${SERVER_VERSION:-18}`.

0 commit comments

Comments
 (0)