Skip to content

Commit 5c3444e

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 e06713a commit 5c3444e

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
@@ -184,17 +184,17 @@ createdb "$dbname3" || createdb_status=$?
184184
if "$MAKE" -C "$oldsrc" installcheck; then
185185
oldpgversion=`psql -X -A -t -d regression -c "SHOW server_version_num"`
186186

187-
# before dumping, get rid of objects not existing in later versions
187+
# before dumping, get rid of objects not feasible in later versions
188188
if [ "$newsrc" != "$oldsrc" ]; then
189189
fix_sql=""
190190
case $oldpgversion in
191191
804??)
192-
fix_sql="DROP FUNCTION public.myfunc(integer); DROP FUNCTION public.oldstyle_length(integer, text);"
193-
;;
194-
*)
195-
fix_sql="DROP FUNCTION public.oldstyle_length(integer, text);"
192+
fix_sql="DROP FUNCTION public.myfunc(integer);"
196193
;;
197194
esac
195+
fix_sql="$fix_sql
196+
DROP FUNCTION IF EXISTS
197+
public.oldstyle_length(integer, text); -- last in 9.6";
198198
psql -X -d regression -c "$fix_sql;" || psql_fix_sql_status=$?
199199
fi
200200

0 commit comments

Comments
 (0)