Index: schema/pgFunction.cpp
===================================================================
--- schema/pgFunction.cpp	(revision 6745)
+++ schema/pgFunction.cpp	(working copy)
@@ -409,13 +409,14 @@
                 type = argTypesTkz.GetNextToken();
                 function->iAddArgType(map[type]);
 
-                // Now add the name, stripping the quotes if
+                // Now add the name, stripping the quotes and \" if
                 // necessary. 
                 name = argNamesTkz.GetNextToken();
                 if (!name.IsEmpty())
                 {
                     if (name[0] == '"')
                         name = name.Mid(1, name.Length()-2);
+                    name.Replace(wxT("\\\""), wxT("\""));
                     function->iAddArgName(name);
                 }
                 else
Index: utils/misc.cpp
===================================================================
--- utils/misc.cpp	(revision 6745)
+++ utils/misc.cpp	(working copy)
@@ -392,7 +394,10 @@
     wxString result = value;
 
     if (needsQuoting(result, true))
+    {
+        result.Replace(wxT("\""), wxT("\"\""));
         return wxT("\"") + result + wxT("\"");
+    }
     else
         return result;
 }
@@ -406,7 +411,10 @@
     wxString result = value;
 
     if (needsQuoting(result, false))
+    {
+        result.Replace(wxT("\""), wxT("\"\""));
         return wxT("\"") + result + wxT("\"");
+    }
     else
         return result;
 }
