diff --git a/pgadmin/dlg/dlgUserMapping.cpp b/pgadmin/dlg/dlgUserMapping.cpp index 372f83b..f7cd30a 100644 --- a/pgadmin/dlg/dlgUserMapping.cpp +++ b/pgadmin/dlg/dlgUserMapping.cpp @@ -285,14 +285,14 @@ wxString dlgUserMapping::GetSql() wxString sqloptions = GetOptionsSql(); if (sqloptions.Length() > 0) { - sql += wxT("ALTER USER MAPPING FOR ") + usermapping->GetUsr() + wxT(" SERVER ") + foreignserver->GetName() + sql += wxT("ALTER USER MAPPING FOR ") + usermapping->GetUsr() + wxT(" SERVER ") + qtIdent(foreignserver->GetName()) + wxT("\n OPTIONS (") + sqloptions + wxT(");\n"); } } else { // create mode - sql = wxT("CREATE USER MAPPING FOR ") + cbUser->GetValue() + wxT(" SERVER ") + foreignserver->GetName(); + sql = wxT("CREATE USER MAPPING FOR ") + cbUser->GetValue() + wxT(" SERVER ") + qtIdent(foreignserver->GetName()); // check for options if (lstOptions->GetItemCount() > 0) diff --git a/pgadmin/schema/pgUserMapping.cpp b/pgadmin/schema/pgUserMapping.cpp index 2df162d..45e6f34 100644 --- a/pgadmin/schema/pgUserMapping.cpp +++ b/pgadmin/schema/pgUserMapping.cpp @@ -97,7 +97,7 @@ wxString pgUserMapping::GetTranslatedMessage(int kindOfMessage) const bool pgUserMapping::DropObject(wxFrame *frame, ctlTree *browser, bool cascaded) { - wxString sql = wxT("DROP USER MAPPING FOR ") + GetUsr() + wxT(" SERVER ") + GetForeignServer()->GetName(); + wxString sql = wxT("DROP USER MAPPING FOR ") + GetUsr() + wxT(" SERVER ") + qtIdent(GetForeignServer()->GetName()); return GetDatabase()->ExecuteVoid(sql); } @@ -107,7 +107,7 @@ wxString pgUserMapping::GetSql(ctlTree *browser) if (sql.IsNull()) { sql = wxT("-- Server: ") + GetQuotedFullIdentifier() + wxT("\n\n") - + wxT("-- DROP USER MAPPING FOR ") + GetUsr() + wxT(" SERVER ") + GetForeignServer()->GetName() + wxT(";") + + wxT("-- DROP USER MAPPING FOR ") + GetUsr() + wxT(" SERVER ") + qtIdent(GetForeignServer()->GetName()) + wxT(";") + wxT("\n\nCREATE USER MAPPING ") + wxT("\n FOR ") + qtIdent(GetUsr()) + wxT("\n SERVER ") + qtIdent(GetForeignServer()->GetName());