我正在尝试恢复数据库。数据库 sql 文件大约 4.5 GB,所以我无法在编辑器上编辑它。我在 postgres 12 中使用以下命令转储数据库;
pg_dump -d postgres > backup.sql
但我在 postgres 9.6 中需要相同的数据库。为此,我编写了以下代码来恢复它
psql -d postgres < backup.sql
它显示这样的错误(创建序列时出错)。但这不是给定问题的重复项。错误信息;
SET
ERROR: unrecognized configuration parameter "default_table_access_method"
CREATE TABLE
ALTER TABLE
ERROR: syntax error at or near "AS"
LINE 2: AS integer
^
ERROR: relation "epicenter.epicenter_gid_seq" does not exist
ERROR: relation "epicenter.epicenter_gid_seq" does not exist
CREATE TABLE
ALTER TABLE
ERROR: syntax error at or near "AS"
LINE 2: AS integer
^
ERROR: relation "public.725_4.5_tur_gid_seq" does not exist
ERROR: relation "public.725_4.5_tur_gid_seq" does not exist
CREATE TABLE
ALTER TABLE
我看到了这个问题的答案。答案已经说过 sql 文件不适用于旧版本。但我想知道,有没有办法使用这个sql文件恢复?