【发布时间】:2021-10-27 12:55:04
【问题描述】:
我创建了一个私有 AWS S3 存储桶并将其放入我使用此命令创建的 database.dump 文件中:
pg_dump -Fc --no-acl --no-owner -h localhost -U myuser -d mydatabase > mydatabase.dump
然后,我创建了一个预置的网址:
aws s3 presign s3://fivbackup/strapifivfr.pgsql --expires-in 604800 --region eu-west-3
我可以按照签名的 URL 下载文件。
当我尝试这个命令时,我得到一个错误:
heroku pg:backups:restore 'RAW_SIGNED_URL' -a fivteam2 DATABASE_URL
//
Restoring... !
! An error occurred and the backup did not finish.
!
! pg_restore: error: could not read from input file: end of file
! pg_restore finished with errors
! waiting for download to complete
! download finished with errors
! please check the source URL and ensure it is publicly accessible
heroku pg:backups:info r013:
=== Backup r013
Database: BACKUP
Started at: 2021-08-27 15:17:09 +0000
Finished at: 2021-08-27 15:17:10 +0000
Status: Failed
Type: Manual
Backup Size: 0.00B (0% compression)
=== Backup Logs
2021-08-27 15:17:10 +0000 2021/08/27 15:17:10 aborting: could not write to output stream: Expected HTTP Status 200, received: "400 Bad Request"
2021-08-27 15:17:10 +0000 waiting for restore to complete
2021-08-27 15:17:10 +0000 pg_restore: error: could not read from input file: end of file
2021-08-27 15:17:10 +0000 pg_restore finished with errors
2021-08-27 15:17:10 +0000 waiting for download to complete
2021-08-27 15:17:10 +0000 download finished with errors
2021-08-27 15:17:10 +0000 please check the source URL and ensure it is publicly accessible
我也尝试了命令heroku pug:push mydatabase DATABASE_URL -a myapp,但无法设置 PGUSER 变量(无法识别术语)。
ps:我在windows上
【问题讨论】:
标签: postgresql amazon-web-services heroku plpgsql heroku-postgres