Skip to content

Commit 2392136

Browse files
committed
In pg_upgrade cross-version test, handle lack of oldstyle_length().
This suffices for testing v12 -> v13; some other version pairs need more changes. Back-patch to v10, which removed the function.
1 parent 5253906 commit 2392136

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/bin/pg_upgrade/test.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,17 @@ createdb "regression$dbname3" || createdb_status=$?
169169
if "$MAKE" -C "$oldsrc" installcheck-parallel; then
170170
oldpgversion=`psql -X -A -t -d regression -c "SHOW server_version_num"`
171171

172-
# before dumping, get rid of objects not existing in later versions
172+
# before dumping, get rid of objects not feasible in later versions
173173
if [ "$newsrc" != "$oldsrc" ]; then
174174
fix_sql=""
175175
case $oldpgversion in
176176
804??)
177-
fix_sql="DROP FUNCTION public.myfunc(integer); DROP FUNCTION public.oldstyle_length(integer, text);"
178-
;;
179-
*)
180-
fix_sql="DROP FUNCTION public.oldstyle_length(integer, text);"
177+
fix_sql="DROP FUNCTION public.myfunc(integer);"
181178
;;
182179
esac
180+
fix_sql="$fix_sql
181+
DROP FUNCTION IF EXISTS
182+
public.oldstyle_length(integer, text); -- last in 9.6";
183183
psql -X -d regression -c "$fix_sql;" || psql_fix_sql_status=$?
184184
fi
185185

0 commit comments

Comments
 (0)