A development environment was mistakenly deleted by a development classmate. When using the text backup file of pg_dump and executing psql to perform a universal restore, an error occurred:
1
2
3
4
5
6
7
8
9
|
$ psql -U postgres -W abce < abce.sql .... invalid command \N invalid command \N invalid command \N invalid command \N invalid command \N invalid command \N .... |
Turn ON_ERROR_STOP to see what errors will occur
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
$ psql -U postgres -W -v ON_ERROR_STOP=1 abce < abce.sql Password : SET SET SET SET SET set_config ------------ (1 row) SET SET SET SET CREATE EXTENSION COMMENT ERROR: could not open extension control file "/usr/pgsql-11/share/extension/postgis.control" : No such file or directory |
Among them,
$ psql -v ON_ERROR_STOP=1
will stop when the first error is encountered.
It turns out that the machine used for temporary recovery does not have postgis installed.
After installing postgis, import the data again and the import is successful!
Similar Posts:
- [Solved] zabbix Monitor postgres Error: “sh:psql command not found”
- How to Solve Error: FATAL: role “root” does not exist
- [Solved] PSQL: fatal: the database system is starting up
- [Solved] psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?
- [How to Solve] psql: FATAL: role “postgres” does not exist
- An error prompt appears during the installation of win10 PostgreSQL: “failed to load SQL modules into the database cluster”
- [Solved] createdb: could not connect to database postgres: FATAL: Peer authentication failed for user “postgres”
- Postgres invalid command data recovery processing
- [Solved] Postgres Error: template1 is being accessed by other users
- error: permission denied to create database [How to Solve]