Skip to content

Commit

Permalink
chore: fix wrappers' lib name
Browse files Browse the repository at this point in the history
  • Loading branch information
pcnc committed Oct 26, 2023
1 parent 567ace8 commit 322ce73
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ OLD_PGVERSION=$(run_sql -A -t -c "SHOW server_version;")

POSTGRES_CONFIG_PATH="/etc/postgresql/postgresql.conf"
PGBINOLD="/usr/lib/postgresql/bin"
PGLIBOLD="/usr/lib/postgresql/lib"

# If upgrading from older major PG versions, disable specific extensions
if [[ "$OLD_PGVERSION" =~ ^14.* ]]; then
Expand Down Expand Up @@ -247,6 +248,18 @@ function initiate_upgrade {

cp --remove-destination "$PGLIBNEW"/*.control "$PGSHARENEW/extension/"
cp --remove-destination "$PGLIBNEW"/*.sql "$PGSHARENEW/extension/"

if [ -d "$PGLIBOLD" ]; then
WRAPPERS_LIB_PATH=$(find "$PGLIBNEW" -name "wrappers*so")
if [ -f "$WRAPPERS_LIB_PATH" ]; then
OLD_WRAPPER_LIB_PATH=$(find "$PGLIBOLD" -name "wrappers*so")
if [ -f "$OLD_WRAPPER_LIB_PATH" ]; then
LIB_FILE_NAME=$(basename "$OLD_WRAPPER_LIB_PATH")
cp "$WRAPPERS_LIB_PATH" "$PGLIBNEW/${LIB_FILE_NAME}"
fi
fi
fi

export LD_LIBRARY_PATH="${PGLIBNEW}"

echo "8. Creating new data directory, initializing database"
Expand Down

0 comments on commit 322ce73

Please sign in to comment.