Skip to content

Commit 71d019c

Browse files
author
Michael Paquier
committed
Avoid regression diffs generated by custom .psqlrc
This is done by using psql with --no-psqlrc mode in related test script.
1 parent bd75d08 commit 71d019c

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

sql/backup_restore.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ pg_ctl start -w -t 3600 > /dev/null 2>&1
106106

107107
# create tablespace and database for pgbench
108108
mkdir -p $TBLSPC_PATH/pgbench
109-
psql -p $TEST_PGPORT postgres <<EOF
109+
psql --no-psqlrc -p $TEST_PGPORT postgres <<EOF
110110
CREATE TABLESPACE pgbench LOCATION '$TBLSPC_PATH/pgbench';
111111
CREATE DATABASE pgbench TABLESPACE = pgbench;
112112
EOF
@@ -125,22 +125,22 @@ grep -c DELETED $BASE_PATH/results/log_show_d_1
125125
pgbench -p $TEST_PGPORT -i -s $SCALE pgbench > $BASE_PATH/results/pgbench.log 2>&1
126126

127127
echo "full database backup"
128-
psql -p $TEST_PGPORT postgres -c "checkpoint"
128+
psql --no-psqlrc -p $TEST_PGPORT postgres -c "checkpoint"
129129
#pg_rman -p $TEST_PGPORT backup --verbose -d postgres > $BASE_PATH/results/log_full_1 2>&1
130130
pg_rman -w -p $TEST_PGPORT backup --verbose -d postgres > $BASE_PATH/results/log_full_1 2>&1
131131

132132
pgbench -p $TEST_PGPORT -T $DURATION -c 10 pgbench >> $BASE_PATH/results/pgbench.log 2>&1
133133
echo "incremental database backup"
134-
psql -p $TEST_PGPORT postgres -c "checkpoint"
134+
psql --no-psqlrc -p $TEST_PGPORT postgres -c "checkpoint"
135135
#pg_rman -p $TEST_PGPORT backup -b i --verbose -d postgres > $BASE_PATH/results/log_incr1 2>&1
136136
pg_rman -w -p $TEST_PGPORT backup -b i --verbose -d postgres > $BASE_PATH/results/log_incr1 2>&1
137137

138138
# validate all backup
139139
pg_rman validate `date +%Y` --verbose > $BASE_PATH/results/log_validate1 2>&1
140140
pg_rman -p $TEST_PGPORT show `date +%Y` -a --verbose -d postgres > $BASE_PATH/results/log_show0 2>&1
141141
pg_dumpall > $BASE_PATH/results/dump_before_rtx.sql
142-
target_xid=`psql -p $TEST_PGPORT pgbench -tAq -c "INSERT INTO pgbench_history VALUES (1) RETURNING(xmin);"`
143-
psql -p $TEST_PGPORT postgres -c "checkpoint"
142+
target_xid=`psql --no-psqlrc -p $TEST_PGPORT pgbench -tAq -c "INSERT INTO pgbench_history VALUES (1) RETURNING(xmin);"`
143+
psql --no-psqlrc -p $TEST_PGPORT postgres -c "checkpoint"
144144
#pg_rman -p $TEST_PGPORT backup -b i --verbose -d postgres > $BASE_PATH/results/log_incr2 2>&1
145145
pg_rman -w -p $TEST_PGPORT backup -b i --verbose -d postgres > $BASE_PATH/results/log_incr2 2>&1
146146

@@ -217,7 +217,7 @@ diff $BASE_PATH/results/dump_before.sql $BASE_PATH/results/dump_after.sql
217217
# take a backup and delete backed up online files
218218
# incrementa backup can't find last full backup because new timeline started.
219219
echo "full database backup after recovery"
220-
psql -p $TEST_PGPORT postgres -c "checkpoint"
220+
psql --no-psqlrc -p $TEST_PGPORT postgres -c "checkpoint"
221221
#pg_rman -p $TEST_PGPORT backup -b f --verbose -d postgres > $BASE_PATH/results/log_full2 2>&1
222222
pg_rman -w -p $TEST_PGPORT backup -b f --verbose -d postgres > $BASE_PATH/results/log_full2 2>&1
223223

@@ -279,4 +279,3 @@ pg_rman -p $TEST_PGPORT show timeline `date +%Y` -a --verbose -d postgres > $BAS
279279

280280
# cleanup
281281
pg_ctl stop -m immediate > /dev/null 2>&1
282-

0 commit comments

Comments
 (0)