Index: frm/frmBackupServer.cpp =================================================================== --- frm/frmBackupServer.cpp (revision 8225) +++ frm/frmBackupServer.cpp (working copy) @@ -143,7 +143,7 @@ cmd += wxT(" --host ") + server->GetName(); cmd += wxT(" --port ") + NumToStr((long)server->GetPort()) - + wxT(" --username ") + server->GetUsername(); + + wxT(" --username ") + commandLineCleanOption(server->GetUsername()); return cmd; } Index: frm/frmBackup.cpp =================================================================== --- frm/frmBackup.cpp (revision 8225) +++ frm/frmBackup.cpp (working copy) @@ -198,7 +198,7 @@ cmd += wxT(" --host ") + server->GetName(); cmd += wxT(" --port ") + NumToStr((long)server->GetPort()) - + wxT(" --username ") + server->GetUsername(); + + wxT(" --username ") + commandLineCleanOption(server->GetUsername()); if (object->GetConnection()->GetIsGreenplum()) cmd += wxT(" --gp-syntax "); @@ -273,9 +273,9 @@ if (object->GetMetaType() == PGM_SCHEMA) #ifdef WIN32 - cmd.Append(wxT(" --schema \\\"") + ((pgSchema*)object)->GetIdentifier() + wxT("\\\"")); + cmd.Append(wxT(" --schema ") + commandLineCleanOption(wxT("\"") + ((pgSchema*)object)->GetIdentifier() + wxT("\""))); #else - cmd.Append(wxT(" --schema '") + ((pgSchema*)object)->GetQuotedIdentifier() + wxT("'")); + cmd.Append(wxT(" --schema ") + commandLineCleanOption(wxT("'") + ((pgSchema*)object)->GetQuotedIdentifier() + wxT("'"))); #endif else if (object->GetMetaType() == PGM_TABLE || object->GetMetaType() == GP_PARTITION) @@ -284,17 +284,19 @@ if (pgAppMinimumVersion(backupExecutable, 8, 2)) { #ifdef WIN32 - cmd.Append(wxT(" --table \"\\\"") + ((pgTable*)object)->GetSchema()->GetIdentifier() + - wxT("\\\".\\\"") + ((pgTable*)object)->GetIdentifier() + wxT("\\\"\"")); + cmd.Append(wxT(" --table ") + + commandLineCleanOption(wxT("\"\"") + ((pgTable*)object)->GetSchema()->GetIdentifier() + + wxT("\".\"") + ((pgTable*)object)->GetIdentifier() + wxT("\"\""))); #else - cmd.Append(wxT(" --table '") + ((pgTable*)object)->GetSchema()->GetQuotedIdentifier() + - wxT(".") + ((pgTable*)object)->GetQuotedIdentifier() + wxT("'")); + cmd.Append(wxT(" --table ") + + commandLineCleanOption(wxT("'") + ((pgTable*)object)->GetSchema()->GetQuotedIdentifier() + + wxT(".") + ((pgTable*)object)->GetQuotedIdentifier() + wxT("'"))); #endif } else { - cmd.Append(wxT(" --table ") + ((pgTable*)object)->GetQuotedIdentifier()); - cmd.Append(wxT(" --schema ") + ((pgTable*)object)->GetSchema()->GetQuotedIdentifier()); + cmd.Append(wxT(" --table ") + commandLineCleanOption(((pgTable*)object)->GetQuotedIdentifier())); + cmd.Append(wxT(" --schema ") + commandLineCleanOption(((pgTable*)object)->GetSchema()->GetQuotedIdentifier())); } } Index: frm/frmBackupGlobals.cpp =================================================================== --- frm/frmBackupGlobals.cpp (revision 8225) +++ frm/frmBackupGlobals.cpp (working copy) @@ -158,7 +158,7 @@ cmd += wxT(" --host ") + server->GetName(); cmd += wxT(" --port ") + NumToStr((long)server->GetPort()) - + wxT(" --username ") + server->GetUsername(); + + wxT(" --username ") + commandLineCleanOption(server->GetUsername()); return cmd; } Index: frm/frmRestore.cpp =================================================================== --- frm/frmRestore.cpp (revision 8225) +++ frm/frmRestore.cpp (working copy) @@ -338,19 +338,19 @@ { int sel=lstContents->GetSelection(); if (lstContents->GetText(sel, 0).Lower() == wxString(_("Function")).Lower()) - cmd.Append(wxT(" --function ") + qtIdent(lstContents->GetText(sel, 1).BeforeLast('('))); + cmd.Append(wxT(" --function ") + commandLineCleanOption(qtIdent(lstContents->GetText(sel, 1).BeforeLast('(')))); else if (lstContents->GetText(sel, 0).Lower() == wxString(_("Table")).Lower()) - cmd.Append(wxT(" --table ") + qtIdent(lstContents->GetText(sel, 1))); + cmd.Append(wxT(" --table ") + commandLineCleanOption(qtIdent(lstContents->GetText(sel, 1)))); else return wxT("restore: internal pgadmin error."); // shouldn't happen! break; } case PGM_TABLE: - cmd.Append(wxT(" --table ") + object->GetQuotedIdentifier()); + cmd.Append(wxT(" --table ") + commandLineCleanOption(object->GetQuotedIdentifier())); break; case PGM_FUNCTION: - cmd.Append(wxT(" --function ") + object->GetQuotedIdentifier()); + cmd.Append(wxT(" --function ") + commandLineCleanOption(object->GetQuotedIdentifier())); break; default: break;