我正在尝试将架构从远程服务器备份和恢复到本地系统。即使pg_dump
和pg_restore
报告相同的版本,后者也会失败并出现熟悉的“不受支持的版本”错误(日志如下)。我以前见过这个错误,当pg_restore
版本比 旧时pg_dump
,但在版本匹配时从未见过。可能是什么原因?
$ psql -h server.somewhere -p 5432 -U user -d database
Password for user user:
psql (16.1 (Ubuntu 16.1-1.pgdg22.04+1), server 14.10)
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)
Type "help" for help.
database=> SELECT version();
version
----------------------------------------------------------------------------------------------------------
PostgreSQL 14.10 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-20), 64-bit
(1 row)
database=> \q
$ pg_dump --version
pg_dump (PostgreSQL) 14.10 (Ubuntu 14.10-1.pgdg22.04+1)
$ pg_restore --version
pg_restore (PostgreSQL) 14.10 (Ubuntu 14.10-1.pgdg22.04+1)
$ pg_dump -h server.somewhere -p 5432 -U user database -n schema_new -F t > ~/temp/schema_new_2024-01-29.backup
$ pg_restore -d wosis ~/temp/schema_new_2024-01-29.backup
pg_restore: error: unsupported version (1.15) in file header