jtonic
9th January 2007 17:17 UTC
PostgreSQL, ExecCmd::exec, large dump file problem
Hi
My installer would install PostgreSQL(silent), and then run 3 sql files (1-make a user, 2-make a database, 3-import nomenclators).
The problem is that the last of them return code 2 and fail to execute (I use ExecCmd::exec).
The dump file is big enough (106 M).
the line that drives me crazy look like
ExecCmd::exec \
'$INSTDIR\Db\bin\psql.exe -q -o "$INSTDIR\Commons\data\arhimed\arhimed.log" -U user db -f "$INSTDIR\Commons\data\arhimed\arhimed.sql"' \
'password$\r$\n'
What can I do against this problem?
Any help is very welcome, jtonic.
Red Wine
9th January 2007 21:29 UTC
This might help, NSIS manual 2.2 Script Files
If you want to use a double-quote in a string you can either use $\" to escape the quote or quote the string with a different type of quote such as ` or '.
Takhir
10th January 2007 07:05 UTC
Plug-in itself uses negative exit codes for it's (internal) errors, so +2 was returned by shell or application. Probably this is "02 File not found". May be quotes for executable can help?
ExecCmd::exec \
'"$INSTDIR\Db\bin\psql.exe" -q -o "$INSTDIR\Commons\data\arhimed\arhimed.log" -U user db -f "$INSTDIR\Commons\data\arhimed\arhimed.sql"' \
'password$\r$\n'
jtonic
10th January 2007 11:59 UTC
ExecCmd::exec questions
First, thanks you for your replies
If I use -W in psql command I force password request, and the following ExecCmd::exec faild to execute [return code 2]
StrCpy $1 '$INSTDIR\Db\bin\psql.exe -q -U postgres -W postgres -f $INSTDIR\Commons\data\arhimed\create_user.sql'
DetailPrint $1
ExecCmd::exec /NOUNLOAD /ASYNC $1 \
"passwordSQL-paSS$\r$\n"
Pop $0
ExecCmd::wait $0
In postgresql server log I discovered:
2007-01-10 13:28:20 FATAL: password authentication failed for user "postgres"
If I remove option -W all its okie, because psql.exe doesn't need password.
Seemed that password passwordSQL-paSS is not recognized (altered, not delivered) by psql.exe command (via ExecCmd::exec).
Another problem is that blank spaces can't be included in ExecCmd::exec command string:
If $INSTDIR is C:\Program files\Iqbyte the ExecCmd::exec failed with code 1. If I execute the same command in terminal all is okie.
Have anyone else faced with these problems? Any helps are very welcome. Cheers, jtonic.