Hi there. Yhis is my first post and I hope someone can help me.
I'm having a problem with QProcess. I'm trying to execute pg_dump (PostgreSQL backup generator) from my application.
I added the agument list containing information about user, host, etc. and setted the enviroment variables to store the password.
I captured the output and received a message from pg_dump that says:
pg_dump: [archiver (db)] connection to database "sgtnewnew" failed: could not translate host name "localhost" to address: Unknown host
pg_dump: *** aborted because of error
pg_dump: [archiver (db)] connection to database "sgtnewnew" failed: could not translate host name "localhost" to address: Unknown host
pg_dump: *** aborted because of error
To copy to clipboard, switch view to plain text mode
The command line I used was:
C:\Arquivos de programas\PostgreSQL\8.2\bin>pg_dump.exe -i -h localhost -p 5432 -U postgres -F c -b -v -f C:\testeBat1.backup sgtnewnew
C:\Arquivos de programas\PostgreSQL\8.2\bin>pg_dump.exe -i -h localhost -p 5432 -U postgres -F c -b -v -f C:\testeBat1.backup sgtnewnew
To copy to clipboard, switch view to plain text mode
I made many tests and it seams that pg_dump.exe has not found it dependencies or something else. I tried to create a .bat file and place it in the postgres/bin folder and then call it using QProcess. I got the same error message. When I ran this .bat file by clicking twice over it, the backup was sucessfully done.
I tried to run it using system(c++ function) and it worked fine. The problem is that I need to capture the output (stdout) and QProcess does it for me.
Dows anyone had any problem like this??
Thans for now
Mário
Bookmarks