我使用 pgadmin 连接到 heroku postgres 数据库并创建了一个包含两个简单列的简单表:
id - bigint identity
name - text
和简单的两行:
id name
1 name1
2 name2
当我执行命令时
heroku pg:pull DATABASE_URL mylocaldb1234 --app nameless-dusk-05113
我得到错误:
pg_restore: error: unrecognized data block type (0) while searching archive
! pg_restore errored with 1
我检查了 postgres 本地和远程版本,它们是相同的。本地版本:
psql --version
psql (PostgreSQL) 12.5
pg_restore --version
pg_restore (PostgreSQL) 12.5
远程版本:
heroku pg:info
=== DATABASE_URL
Plan: Hobby-dev
Status: Available
Connections: 5/20
PG Version: 12.5
Created: 2021-01-07 07:29 UTC
Data Size: 8.2 MB
Tables: 1
Rows: 2/10000 (In compliance)
Fork/Follow: Unsupported
Rollback: Unsupported
Continuous Protection: Off
Add-on: postgresql-spherical-97042
远程 pg_restore 版本:
heroku run pg_restore --version
Running pg_restore --version on ⬢ nameless-dusk-05113... up, run.7775 (Free)
pg_restore (PostgreSQL) 12.5 (Ubuntu 12.5-1.pgdg18.04+1)