Hi.
I use latest version of Postgre in windows XP
I try to restore a database from .tar backup,into a new database.Using EMS Manager
it works fine,my database is creating and restoring succesfully.
My application creates a .bat file and run it,restore is unsuccesfully
but file is :
@echo off
"pg_restore.exe" -h 192.168.1.1 -p 5432 -U postgres -C -v "stru.tar" 2>>log_resto.txt
echo %errorlevel% >err_resto.txt
log file is :
pg_restore: creating DATABASE _struct_fis_
pg_restore: connecting to new database "_struct_fis_"
pg_restore: creating SCHEMA pos
pg_restore: creating SCHEMA public
pg_restore: creating COMMENT SCHEMA public
pg_restore: creating PROCEDURAL LANGUAGE plpgsql
pg_restore: creating TABLE SALI
pg_restore: creating TABLE comenzi
pg_restore: creating TABLE comenzi_desf
pg_restore: creating TABLE mese
pg_restore: creating TABLE operatori
pg_restore: creating TABLE societati
pg_restore: creating SEQUENCE comenzi_desf_idcomanda_seq
pg_restore: executing SEQUENCE SET comenzi_desf_idcomanda_seq
pg_restore: creating SEQUENCE comenzi_desf_poz_seq
pg_restore: creating SEQUENCE OWNED BY comenzi_desf_poz_seq
pg_restore: executing SEQUENCE SET comenzi_desf_poz_seq
pg_restore: creating SEQUENCE comenzi_id_masa_seq
pg_restore: executing SEQUENCE SET comenzi_id_masa_seq
pg_restore: creating SEQUENCE comenzi_id_sala_seq
pg_restore: executing SEQUENCE SET comenzi_id_sala_seq
pg_restore: creating SEQUENCE comenzi_id_seq
pg_restore: creating SEQUENCE OWNED BY comenzi_id_seq
pg_restore: executing SEQUENCE SET comenzi_id_seq
pg_restore: creating SEQUENCE mese_id_sali_seq
pg_restore: executing SEQUENCE SET mese_id_sali_seq
pg_restore: creating SEQUENCE mese_id_seq
pg_restore: executing SEQUENCE SET mese_id_seq
pg_restore: creating SEQUENCE operatori_id_seq
pg_restore: executing SEQUENCE SET operatori_id_seq
pg_restore: creating SEQUENCE sali_id_seq
pg_restore: executing SEQUENCE SET sali_id_seq
pg_restore: creating DEFAULT id
pg_restore: creating DEFAULT poz
pg_restore: restoring data for table "SALI"
pg_restore: restoring data for table "comenzi"
pg_restore: restoring data for table "comenzi_desf"
pg_restore: restoring data for table "mese"
pg_restore: restoring data for table "operatori"
pg_restore: restoring data for table "societati"
pg_restore: creating CONSTRAINT SALI_pkey
pg_restore: creating CONSTRAINT comenzi_desf_IdComanda_key
pg_restore: creating CONSTRAINT comenzi_desf_pkey
pg_restore: creating CONSTRAINT comenzi_id_masa_key
pg_restore: creating CONSTRAINT comenzi_id_sala_key
pg_restore: creating CONSTRAINT comenzi_pkey
pg_restore: creating CONSTRAINT mese_id_Sali_key
pg_restore: creating CONSTRAINT mese_pkey
pg_restore: creating CONSTRAINT operatori_pkey
pg_restore: creating CONSTRAINT societati_pkey
pg_restore: creating FK CONSTRAINT comenzi_desf_fk
pg_restore: creating FK CONSTRAINT comenzi_fk
pg_restore: creating FK CONSTRAINT comenzi_fk1
pg_restore: creating FK CONSTRAINT comenzi_fk2
pg_restore: creating FK CONSTRAINT mese_fk
pg_restore: setting owner and privileges for DATABASE _struct_fis_
pg_restore: setting owner and privileges for SCHEMA pos
pg_restore: setting owner and privileges for SCHEMA public
pg_restore: setting owner and privileges for COMMENT SCHEMA public
pg_restore: setting owner and privileges for ACL public
pg_restore: setting owner and privileges for PROCEDURAL LANGUAGE plpgsql
pg_restore: setting owner and privileges for TABLE SALI
pg_restore: setting owner and privileges for TABLE comenzi
pg_restore: setting owner and privileges for TABLE comenzi_desf
pg_restore: setting owner and privileges for TABLE mese
pg_restore: setting owner and privileges for TABLE operatori
pg_restore: setting owner and privileges for TABLE societati
pg_restore: setting owner and privileges for SEQUENCE comenzi_desf_idcomanda_seq
pg_restore: setting owner and privileges for SEQUENCE comenzi_desf_poz_seq
pg_restore: setting owner and privileges for SEQUENCE OWNED BY comenzi_desf_poz_seq
pg_restore: setting owner and privileges for SEQUENCE comenzi_id_masa_seq
pg_restore: setting owner and privileges for SEQUENCE comenzi_id_sala_seq
pg_restore: setting owner and privileges for SEQUENCE comenzi_id_seq
pg_restore: setting owner and privileges for SEQUENCE OWNED BY comenzi_id_seq
pg_restore: setting owner and privileges for SEQUENCE mese_id_sali_seq
pg_restore: setting owner and privileges for SEQUENCE mese_id_seq
pg_restore: setting owner and privileges for SEQUENCE operatori_id_seq
pg_restore: setting owner and privileges for SEQUENCE sali_id_seq
pg_restore: setting owner and privileges for DEFAULT id
pg_restore: setting owner and privileges for DEFAULT poz
pg_restore: setting owner and privileges for CONSTRAINT SALI_pkey
pg_restore: setting owner and privileges for CONSTRAINT comenzi_desf_IdComanda_key
pg_restore: setting owner and privileges for CONSTRAINT comenzi_desf_pkey
pg_restore: setting owner and privileges for CONSTRAINT comenzi_id_masa_key
pg_restore: setting owner and privileges for CONSTRAINT comenzi_id_sala_key
pg_restore: setting owner and privileges for CONSTRAINT comenzi_pkey
pg_restore: setting owner and privileges for CONSTRAINT mese_id_Sali_key
pg_restore: setting owner and privileges for CONSTRAINT mese_pkey
pg_restore: setting owner and privileges for CONSTRAINT operatori_pkey
pg_restore: setting owner and privileges for CONSTRAINT societati_pkey
pg_restore: setting owner and privileges for FK CONSTRAINT comenzi_desf_fk
pg_restore: setting owner and privileges for FK CONSTRAINT comenzi_fk
pg_restore: setting owner and privileges for FK CONSTRAINT comenzi_fk1
pg_restore: setting owner and privileges for FK CONSTRAINT comenzi_fk2
pg_restore: setting owner and privileges for FK CONSTRAINT mese_fk
but on the server is no database called _struct_fis_
err_resto.txt file contents only "0".
If I add -d
@echo off
"pg_restore.exe" -h 192.168.1.1 -p 5432 -U postgres -d "_struct_fis_" -C -v "stru.tar" 2>>log_resto.txt
echo %errorlevel% >err_resto.txt
error is "1" and log file :
pg_restore: connecting to database for restore
pg_restore: [archiver (db)] connection to database "_struct_fis_" failed: FATAL: database "_struct_fis_" does not exist
pg_restore: *** aborted because of error
Thanks for any advice
I use latest version of Postgre in windows XP
I try to restore a database from .tar backup,into a new database.Using EMS Manager
it works fine,my database is creating and restoring succesfully.
My application creates a .bat file and run it,restore is unsuccesfully
but file is :
@echo off
"pg_restore.exe" -h 192.168.1.1 -p 5432 -U postgres -C -v "stru.tar" 2>>log_resto.txt
echo %errorlevel% >err_resto.txt
log file is :
pg_restore: creating DATABASE _struct_fis_
pg_restore: connecting to new database "_struct_fis_"
pg_restore: creating SCHEMA pos
pg_restore: creating SCHEMA public
pg_restore: creating COMMENT SCHEMA public
pg_restore: creating PROCEDURAL LANGUAGE plpgsql
pg_restore: creating TABLE SALI
pg_restore: creating TABLE comenzi
pg_restore: creating TABLE comenzi_desf
pg_restore: creating TABLE mese
pg_restore: creating TABLE operatori
pg_restore: creating TABLE societati
pg_restore: creating SEQUENCE comenzi_desf_idcomanda_seq
pg_restore: executing SEQUENCE SET comenzi_desf_idcomanda_seq
pg_restore: creating SEQUENCE comenzi_desf_poz_seq
pg_restore: creating SEQUENCE OWNED BY comenzi_desf_poz_seq
pg_restore: executing SEQUENCE SET comenzi_desf_poz_seq
pg_restore: creating SEQUENCE comenzi_id_masa_seq
pg_restore: executing SEQUENCE SET comenzi_id_masa_seq
pg_restore: creating SEQUENCE comenzi_id_sala_seq
pg_restore: executing SEQUENCE SET comenzi_id_sala_seq
pg_restore: creating SEQUENCE comenzi_id_seq
pg_restore: creating SEQUENCE OWNED BY comenzi_id_seq
pg_restore: executing SEQUENCE SET comenzi_id_seq
pg_restore: creating SEQUENCE mese_id_sali_seq
pg_restore: executing SEQUENCE SET mese_id_sali_seq
pg_restore: creating SEQUENCE mese_id_seq
pg_restore: executing SEQUENCE SET mese_id_seq
pg_restore: creating SEQUENCE operatori_id_seq
pg_restore: executing SEQUENCE SET operatori_id_seq
pg_restore: creating SEQUENCE sali_id_seq
pg_restore: executing SEQUENCE SET sali_id_seq
pg_restore: creating DEFAULT id
pg_restore: creating DEFAULT poz
pg_restore: restoring data for table "SALI"
pg_restore: restoring data for table "comenzi"
pg_restore: restoring data for table "comenzi_desf"
pg_restore: restoring data for table "mese"
pg_restore: restoring data for table "operatori"
pg_restore: restoring data for table "societati"
pg_restore: creating CONSTRAINT SALI_pkey
pg_restore: creating CONSTRAINT comenzi_desf_IdComanda_key
pg_restore: creating CONSTRAINT comenzi_desf_pkey
pg_restore: creating CONSTRAINT comenzi_id_masa_key
pg_restore: creating CONSTRAINT comenzi_id_sala_key
pg_restore: creating CONSTRAINT comenzi_pkey
pg_restore: creating CONSTRAINT mese_id_Sali_key
pg_restore: creating CONSTRAINT mese_pkey
pg_restore: creating CONSTRAINT operatori_pkey
pg_restore: creating CONSTRAINT societati_pkey
pg_restore: creating FK CONSTRAINT comenzi_desf_fk
pg_restore: creating FK CONSTRAINT comenzi_fk
pg_restore: creating FK CONSTRAINT comenzi_fk1
pg_restore: creating FK CONSTRAINT comenzi_fk2
pg_restore: creating FK CONSTRAINT mese_fk
pg_restore: setting owner and privileges for DATABASE _struct_fis_
pg_restore: setting owner and privileges for SCHEMA pos
pg_restore: setting owner and privileges for SCHEMA public
pg_restore: setting owner and privileges for COMMENT SCHEMA public
pg_restore: setting owner and privileges for ACL public
pg_restore: setting owner and privileges for PROCEDURAL LANGUAGE plpgsql
pg_restore: setting owner and privileges for TABLE SALI
pg_restore: setting owner and privileges for TABLE comenzi
pg_restore: setting owner and privileges for TABLE comenzi_desf
pg_restore: setting owner and privileges for TABLE mese
pg_restore: setting owner and privileges for TABLE operatori
pg_restore: setting owner and privileges for TABLE societati
pg_restore: setting owner and privileges for SEQUENCE comenzi_desf_idcomanda_seq
pg_restore: setting owner and privileges for SEQUENCE comenzi_desf_poz_seq
pg_restore: setting owner and privileges for SEQUENCE OWNED BY comenzi_desf_poz_seq
pg_restore: setting owner and privileges for SEQUENCE comenzi_id_masa_seq
pg_restore: setting owner and privileges for SEQUENCE comenzi_id_sala_seq
pg_restore: setting owner and privileges for SEQUENCE comenzi_id_seq
pg_restore: setting owner and privileges for SEQUENCE OWNED BY comenzi_id_seq
pg_restore: setting owner and privileges for SEQUENCE mese_id_sali_seq
pg_restore: setting owner and privileges for SEQUENCE mese_id_seq
pg_restore: setting owner and privileges for SEQUENCE operatori_id_seq
pg_restore: setting owner and privileges for SEQUENCE sali_id_seq
pg_restore: setting owner and privileges for DEFAULT id
pg_restore: setting owner and privileges for DEFAULT poz
pg_restore: setting owner and privileges for CONSTRAINT SALI_pkey
pg_restore: setting owner and privileges for CONSTRAINT comenzi_desf_IdComanda_key
pg_restore: setting owner and privileges for CONSTRAINT comenzi_desf_pkey
pg_restore: setting owner and privileges for CONSTRAINT comenzi_id_masa_key
pg_restore: setting owner and privileges for CONSTRAINT comenzi_id_sala_key
pg_restore: setting owner and privileges for CONSTRAINT comenzi_pkey
pg_restore: setting owner and privileges for CONSTRAINT mese_id_Sali_key
pg_restore: setting owner and privileges for CONSTRAINT mese_pkey
pg_restore: setting owner and privileges for CONSTRAINT operatori_pkey
pg_restore: setting owner and privileges for CONSTRAINT societati_pkey
pg_restore: setting owner and privileges for FK CONSTRAINT comenzi_desf_fk
pg_restore: setting owner and privileges for FK CONSTRAINT comenzi_fk
pg_restore: setting owner and privileges for FK CONSTRAINT comenzi_fk1
pg_restore: setting owner and privileges for FK CONSTRAINT comenzi_fk2
pg_restore: setting owner and privileges for FK CONSTRAINT mese_fk
but on the server is no database called _struct_fis_
err_resto.txt file contents only "0".
If I add -d
@echo off
"pg_restore.exe" -h 192.168.1.1 -p 5432 -U postgres -d "_struct_fis_" -C -v "stru.tar" 2>>log_resto.txt
echo %errorlevel% >err_resto.txt
error is "1" and log file :
pg_restore: connecting to database for restore
pg_restore: [archiver (db)] connection to database "_struct_fis_" failed: FATAL: database "_struct_fis_" does not exist
pg_restore: *** aborted because of error
Thanks for any advice