Skip to content

Commit 9d7ed6f

Browse files
committed
fix: clean up restored cluster schemas
1 parent 9cb0f31 commit 9d7ed6f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

internal/workers/crunchy_bridge_restore.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,16 @@ while [ ${RETRY_COUNT} -lt ${MAX_RETRIES} ]; do
288288
sleep 1
289289
done
290290

291-
# 8. Clean up pgBackRest config (contains credentials)
291+
# 8. Clean up Crunchy Bridge internal schemas and extensions
292+
log "Cleaning up schemas and extensions..."
293+
294+
sudo -u postgres ${PG_BIN}/psql -p ${PG_PORT} -h 127.0.0.1 -d ${DATABASE_NAME} << 'EOSQL'
295+
DROP SCHEMA IF EXISTS perfsnap CASCADE;
296+
DROP SCHEMA IF EXISTS hint_plan CASCADE;
297+
DROP EXTENSION IF EXISTS crunchy_pooler CASCADE;
298+
DROP EXTENSION IF EXISTS pg_stat_statements CASCADE;
299+
EOSQL
300+
292301
log "Cleaning up pgBackRest config..."
293302
if [ -f "${PGBACKREST_CONF}" ]; then
294303
rm -f "${PGBACKREST_CONF}" || log "Warning: Could not remove pgBackRest config"

0 commit comments

Comments
 (0)