Index: include/frm/frmRestore.h
===================================================================
--- include/frm/frmRestore.h	(revision 8225)
+++ include/frm/frmRestore.h	(working copy)
@@ -39,9 +39,6 @@
     void OnChangeList(wxListEvent &ev);
     void OnEndProcess(wxProcessEvent& event);
 
-    wxString getCmdPart1();
-    wxString getCmdPart2(int step);
-
     frmMain *form;
     pgObject *object;
     pgServer *server;
Index: frm/frmRestore.cpp
===================================================================
--- frm/frmRestore.cpp	(revision 8225)
+++ frm/frmRestore.cpp	(working copy)
@@ -251,22 +251,6 @@
 
 wxString frmRestore::GetCmd(int step)
 {
-    wxString cmd = getCmdPart1();
-
-    return cmd + getCmdPart2(step);
-}
-
-
-wxString frmRestore::GetDisplayCmd(int step)
-{
-    wxString cmd = getCmdPart1();
-
-    return cmd + getCmdPart2(step);
-}
-
-
-wxString frmRestore::getCmdPart1()
-{
     wxString cmd;
 
     cmd = restoreExecutable;
@@ -277,14 +261,7 @@
     cmd += wxT(" --port ") + NumToStr((long)server->GetPort())
          + wxT(" --username ") + qtIdent(server->GetUsername())
          + wxT(" --dbname ") + commandLineCleanOption(object->GetDatabase()->GetQuotedIdentifier());
-    return cmd;
-}
 
-
-wxString frmRestore::getCmdPart2(int step)
-{
-    wxString cmd;
-
     if (step)
     {
         cmd.Append(wxT(" --list"));
@@ -334,7 +311,6 @@
         wxTreeItemId root, firstLevelObject, secondLevelObject;
         wxTreeItemIdValue firstLevelObjectData, secondLevelObjectData;
         bool partialDump = false;
-
         // Get root object
         root = ctvObjects->GetRootItem();
 
@@ -400,19 +376,38 @@
             switch (object->GetMetaType())
             {
                 case PGM_FUNCTION:
-                    cmd.Append(wxT(" --function ") + object->GetFullName());
+                    cmd.Append(wxT(" --function ") + commandLineCleanOption(qtIdent(object->GetFullName())));
                     break;
                 case PGM_INDEX:
-                    cmd.Append(wxT(" --index ") + object->GetQuotedIdentifier());
+                    cmd.Append(wxT(" --index ") + commandLineCleanOption(object->GetQuotedIdentifier()));
                     break;
                 case PGM_SCHEMA:
-                    cmd.Append(wxT(" --schema ") + object->GetQuotedIdentifier());
+                    cmd.Append(wxT(" --schema ") + commandLineCleanOption(object->GetQuotedIdentifier()));
                     break;
                 case PGM_TABLE:
-                    cmd.Append(wxT(" --table ") + object->GetQuotedIdentifier());
+                {
+                    // The syntax changed in 8.2 :-(
+                    if (pgAppMinimumVersion(restoreExecutable, 8, 2))
+                    {
+                        wxString strTable;
+#ifdef WIN32
+                        strTable = wxT("\"") + ((pgTable*)object)->GetSchema()->GetQuotedIdentifier() + 
+                                   wxT("\".\"") + ((pgTable*)object)->GetQuotedIdentifier() + wxT("\"");
+#else
+                        strTable = wxT("'") + ((pgTable*)object)->GetSchema()->GetQuotedIdentifier() + 
+                                   wxT(".") + ((pgTable*)object)->GetQuotedIdentifier() + wxT("'");
+#endif
+                        cmd.Append(wxT(" --table ") + commandLineCleanOption(strTable));
+                    }
+                    else
+                    {
+                        cmd.Append(wxT(" --table ") + commandLineCleanOption(((pgTable*)object)->GetQuotedIdentifier()));
+                        cmd.Append(wxT(" --schema ") + commandLineCleanOption(((pgTable*)object)->GetSchema()->GetQuotedIdentifier()));
+                    }
                     break;
+                }
                 case PGM_TRIGGER:
-                    cmd.Append(wxT(" --trigger ") + object->GetQuotedIdentifier());
+                    cmd.Append(wxT(" --trigger ") + commandLineCleanOption(object->GetQuotedIdentifier()));
                     break;
                 default:
                     break;
@@ -432,6 +427,12 @@
 }
 
 
+wxString frmRestore::GetDisplayCmd(int step)
+{
+      return GetCmd(step);
+}
+
+
 void frmRestore::OnView(wxCommandEvent &ev)
 {
     btnView->Disable();
Index: pgAdmin3.vcproj
===================================================================
--- pgAdmin3.vcproj	(revision 8225)
+++ pgAdmin3.vcproj	(working copy)
@@ -444,7 +444,7 @@
 				>
 			</File>
 			<File
-				RelativePath=".\ctl\xh_ctlchecktreeview.cpp"
+				RelativePath=".\ctl\xh_ctlcolourpicker.cpp"
 				>
 			</File>
 			<File
