File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
2523if [ -z " ${DATABASE_URL:- " " } " ]; then
Original file line number Diff line number Diff line change 2020PG_RESTORE=" pg_restore-$SERVER_VERSION "
2121
2222if ! 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
2525fi
2626
2727echo " Dropping all objects owned by \" $USER \" in the database..."
Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
22"""Dump out a DATABASE_URL provided in the environment as individual variables"""
33import os
4- import sys
54from urllib .parse import urlparse
65
76parsed = urlparse (os .environ ["DATABASE_URL" ])
Original file line number Diff line number Diff line change 99 and running the script against a PostgreSQL 18 server.
10103 . 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} ` .
You can’t perform that action at this time.
0 commit comments