Skip site navigation (1) Skip section navigation (2)

Re: problems restoring database from plain text backup from psql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Oleg <evdakov(at)iwk(dot)uka(dot)de>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: problems restoring database from plain text backup from psql
Date: 2005-12-20 14:38:16
Message-ID: 28834.1135089496@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
Oleg <evdakov(at)iwk(dot)uka(dot)de> writes:
> One more thing to mention is that this database is PostGIS enabled. So I 
> had to remove all CREATE FUNCTION commands in the backup file.

Don't remove them; instead, load an up-to-date version of PostGIS into
the database before you try to restore the dump.  You'll then get
"duplicate function" complaints during the restore, but you can ignore
those.  This avoids the risk of introducing errors into the dump by
manual editing.

> In the mean time I tried to restore with psql:
> psql mydb < mybackup.sql -U postgres
> Unfortunately I have no possibility to enter my password

On Windows you must use "-f mybackup.sql" --- if you use "<" then that
commandeers stdin entirely and so there's no way to enter a password
from the keyboard.  Alternatively, start psql normally and then read
the dump file with "\i mybackup.sql".

			regards, tom lane

In response to

pgsql-novice by date

Next:From: OlegDate: 2005-12-20 15:54:15
Subject: transfer database from Linux to Windows
Previous:From: OlegDate: 2005-12-20 14:22:35
Subject: problems restoring database from plain text backup from psql

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group