Hello.
I'm developing an application and it has to backup and restore database using pg_dump & pg_restore.
the database is PostgreSql7.2.3 and pg_dump.exe & pg_restore.exe is from pg admin III.
The command I've used for backup and restore are:
pg_dump -i -h 172.17.5.82 -p 5432 -U livo -F t -c -C -D -v -f c:\backup.tar livo
pg_restore -i -c -F t -v -h 172.17.5.82 -p 5432 -U livo -d livo -v c:\backup.tar
it backs up fine, but errors occur while restoring.
the error says: could not set search_path to "public", parse error at or near "public", could not execute query. Command was:
DROP TABLE public.myTable;
could not execute query. relation "myTable" already exists:
It fails to drop an table because it doesnt understand "public" and copies the rows in table myTable. Therefore, it's end up with doubled duplicated rows.
I guessed it should be fine if I add "public" to an environment variable 'search_path', but I just found that 'search_path' was first introduced at PostgreSQL 7.3. ( mine is 7.2.3 ).
It's just simple backup & restore. just backup several tables and restore.
no functions and no complicated work.
I suggested that let's just manually(?) drop the tables in the application before restoring but my boss said it's not an option.
Is there any smart solution on this?
Thank you.