diff --git a/testing/run_regressions.sh b/testing/run_regressions.sh index 79aa0d4b..084d210f 100755 --- a/testing/run_regressions.sh +++ b/testing/run_regressions.sh @@ -140,7 +140,16 @@ restore_database() { dump_database() { TEST="Dump-Database" - pg_dump -Fp $PSQLOPTS ${DBNAME} > "${REGRESSION}/initial.dbdump" 2>&1 + pg_dump -Fp $PSQLOPTS ${DBNAME} \ + | grep -v -E '(CREATE\ EXTENSION|COMMENT\ ON)' \ + > "${REGRESSION}/initial.dbdump" 2>&1 + + # This is ugly, for the COPY into dav_binding to work on Pg >= 9.6 (possibly earlier) + # we need to ensure that the schema that collection is in is within our search path + # since the function real_path_exists is called on each insert into dav_binding and + # it doesn't specify the schema for 'collection', therefore the copy fails. + schema=$(grep "CREATE TABLE .*.collection" "${REGRESSION}/initial.dbdump" | sed -r 's/CREATE TABLE (.*?)\.collection \(/\1/') + sed -i "s/SELECT pg_catalog.set_config('search_path', '', false);/SELECT pg_catalog.set_config('search_path', '$schema', false);/" "${REGRESSION}/initial.dbdump" } diff --git a/testing/tests/binding/Restore-Database.result b/testing/tests/binding/Restore-Database.result index 531cd320..39b29eaf 100644 --- a/testing/tests/binding/Restore-Database.result +++ b/testing/tests/binding/Restore-Database.result @@ -1,4 +1,8 @@ -psql:tests/binding/initial.dbdump:28: ERROR: must be owner of extension plpgsql + set_config +------------ + public +(1 row) + setval -------- 1601 diff --git a/testing/tests/carddav/Restore-Database.result b/testing/tests/carddav/Restore-Database.result index a283b488..ea9b3017 100644 --- a/testing/tests/carddav/Restore-Database.result +++ b/testing/tests/carddav/Restore-Database.result @@ -1,4 +1,8 @@ -psql:tests/carddav/initial.dbdump:28: ERROR: must be owner of extension plpgsql + set_config +------------ + public +(1 row) + setval -------- 1633 diff --git a/testing/tests/scheduling/Restore-Database.result b/testing/tests/scheduling/Restore-Database.result index d9369f29..392e510a 100644 --- a/testing/tests/scheduling/Restore-Database.result +++ b/testing/tests/scheduling/Restore-Database.result @@ -1,4 +1,8 @@ -psql:tests/scheduling/initial.dbdump:28: ERROR: must be owner of extension plpgsql + set_config +------------ + public +(1 row) + setval -------- 1648