The problem discussed in this article has been solved by the pgAdmin team (tested on the pgAdmin 1.4). If you come across this problem and you have a pgAdmin version older than version 4, just download and install the latest version). Nevertheless this method can, always, be used to circumvent possible pgAdmin error by re-using the syntax recovered on the error window.

Recently, the new version PostgreSQL 9.6 has been made available. Among the new features , a new PgAdmin client interface is available ( PgAdmin 4 v1.1).
If you want to migrate databases from a previous version of PostgreSQL to a9.6 base, it won’t be easy !
First let’s set the scene: I ‘ll only talk about Windows work, I do not have any info whether the same happens in Linux.
Second, last month, I reported the bug to the PgAdmin team, but, up to this date nothing has changed. But, since we must continue working, here is a way around the problem.
Let’s start with the problem .
If you Have PostgreSQL databases in earlier versions (9.5 and below) and you want to migrate them towards a PostgreSQL 9.6 database

In this example, we want to migrate all the tables to the postgis_22_sample database server postgreSQL 9.5 to the server’s postgis_23_sample database postgreSQL 9.6.

The PgAdmin method consists in backing up the first database to an external file (.backup),and, then restore this file in the second base.

With PgAdmlin 4 there is a new option to export a table to a file text, and then import it into the new database. But this applies to just one table.

be aware that both methods crash…

We launch the backup of the database postgis_22_sample

We choose only the directory and name of the backup file , then we click on backup.

In the lower right corner of the screen you see the process monitoring window:

After a few seconds , the message indicates an error :

Click on the link Click here for details To open the window of information

The error message indicates that the UTF-8 Codec has crashed .

It is this type of message you will have :

if you try to save a base from a previous version

if you try to restore a database from a file created under a previous version

if you try export a table with the Export / Import command

The way around the problem is to not use PgAdmin 4 to perform the operation . With the mouse , select the text of the ” Running command “

Press Ctrl C to copy this text to the

Open a file text on your desktop ( right click on the desktop -> New -> Text Document )

Paste the text of the command

We will execute this command through a command window. The problem is that, as it is, it will not run because of the spaces in the programme tree (pgdump.exe). In order to run it, we have to surround the text