Due to this change in user permission in postgres 15:
https://stackoverflow.com/questions/74110708/postgres-15-permission-denied-for-schema-public/74111630#comment130849690_74110708
I tried running the db:setup rake task prior to running the backup script.
During backup restore, all SQL statements fail due to permission error.
I am upgrading from 15.11.5 to 16.0.0. Postgres 12 to 15 (using the sameersbn/postgres images).