Cannot import database exported by phpPgAdmin
-
03-10-2020 - |
سؤال
I have exported database with phpPgAdmin tool - format sql, structure and data.
When I try to import this sql using:
psql command \i filename.sql
After some time (file is 2GB) I get following error:
ERROR: unterminated quoted string at or near ".. , '\x25504... "
with "arrow" pointing to \x.
Looks like \ is making a problem here...
المحلول
Looking at this tutorial, seems like phpPgAdmin
make a call for pg_dump
to export the data.
To process plain files with psql
, you must use the -f
option, eg:
psql \
-U postgres \
-d database_name \
-f phppgadmin_dump_file.sql
I strongly recommend using pg_dump
manually with the option --format=custom
to make the restore more flexible (and use the tool pg_restore
).
Please, take a look at this URL to restore de file using phpPgAdmin
itself:
لا تنتمي إلى dba.stackexchange