The backup is a "custom format" backup, not an SQL script. You restore it with the pg_restore
command. See the docs for pg_restore
.
The encoding thing will be a bigger issue. The situation with locales and encodings between Windows and Linux with PostgreSQL is terrible. pg_restore
is likely to fail to create the DB if told to create it as part of the restore process, because the ctype English_United States.1252
does not exist on Mac OS X, it's a Windows-ism.
I think what you will have to do is CREATE DATABASE
the database yourself with a corresponding LC_CTYPE
and LC_COLLATE
like en_US.utf-8
. Then restore to the existing DB.