pg_restore error from pgadmin3 - Postgresql

Sangram Anand picture Sangram Anand · Oct 2, 2013 · Viewed 12.3k times · Source

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 I am 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

Answer

Jonathon Richardson picture Jonathon Richardson · Jul 9, 2015

By default, pgAdmin uses it's own binaries, which in this case may be higher (or lower) than the version of PostgreSQL you're working with. You can configure pgAdmin to use the binaries from a local installation of PostgreSQL, if your database is local. If the database you are working with is remote, you may consider installing a copy of that version of PostgreSQL locally, so you can use the binaries.

In Preferences -> Browser -> Binary paths, set the PG bin path to be the path to your local installation of PostgreSQL (or any local install, as long as it is the same version as the database).

Configuring a new location for the PG binaries is best if you primarily work with a single version of PostgreSQL at a time, and are using the latest pgAdmin. However, if you use multiple versions of PostgreSQL simultaneously, using the command line may be better. Personally, in that case, I still use pgAdmin to start the restore and let it error out, then use the command line flags that the gui built (which you can find in the log file) to copy and paste into my terminal program (you may have to remove the --no-password flag).