1

We face a situation where pg_restore drops extension plpgsql and then recreates it. This is done by a CI job we have but i could not reproduce it. These are the commands we use:

  • pg_dump -d $DATABASE_URL -j 8 -Z 0 -Fd -f ${backupDir}
  • psql -d $DATABASE_URL -c "DROP SCHEMA IF EXISTS public CASCADE;
  • psql $DATABASE_URL -c "CREATE SCHEMA public; GRANT ALL ON SCHEMA public TO public;
  • pg_restore --verbose --clean --no-owner -d $DATABASE_URL -j 8 --format=d ${backupDir}

And these are the logs:

1 Answer 1

0

The aws_s3 extension seems to be buggy: it lacks the dependency on the plpgsql extension. You should report that as a bug to Amazon. As a workaround, don't use the --clean option, but restore to a new, empty database.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.