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 -foption, 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:

  • I will accept this answer because it's valid. My problem was that database was/is on jelastic and with default settings (no public ip) I cannot directly access the database with pg_dump tool... I ended up changing that ip setting and "re-dumped" the database with -Fc option and it worked. – Kamil Aug 5 '16 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.