Postgresql – pg_restore error from pgadmin3 – Postgresql

pgadminpostgresql

i have taken a backup of a postgresql db from a system1 using pgadmin3 tool. The backup file created is of extension ".backup"

I am trying to restore it on an another system2 installed with postgresql 9.0 and pgadmin3 1.8
but iam getting the error

could not execute query: ERROR: unrecognized configuration parameter
"lock_timeout" Command was: SET lock_timeout = 0;

configuration of both the systems

system1
win7-64bit
postgresql 9.0.13-1 – 64bit
pgadmin 1.8

system2
win7-32bit
postgresql 9.0.13-1 – 32bit
pgadmin 1.8

Best Answer

lock_timeout is a new parameter that appeared with PostgreSQL 9.3

Per the release notes:

Add configuration variable lock_timeout to allow limiting how long a session will wait to acquire any one lock (Zoltán Böszörményi)

That would indicate that pgadmin is using a PostgreSQL 9.3 pg_dump command to take the backup, instead of 9.0.

This is recommended only when migrating to 9.3. Since the target server is 9.0, better use the pg_dump binary that has been installed with the 9.0 server.

The path of external binaries can be set in pgAdmin preferences. To fix the problem, you may set it to the bin directory of your 9.0 installation and try to backup again.

Other than that, as a one-time fix you may edit the dump file if it's in plain text, remove the offending line SET lock_timeout = 0; in the hope that it's the only problem caused by the version mismatch.