Index: pgSet.cpp
===================================================================
--- pgSet.cpp	(revision 7497)
+++ pgSet.cpp	(working copy)
@@ -191,7 +191,9 @@
     
     if (needColQuoting)
     {
-        col = PQfnumber(res, (wxT("\"") + colname + wxT("\"")).mb_str(conv));
+        wxString quotedColName = colname;
+        quotedColName.Replace(wxT("\""), wxT("\"\""));
+        col = PQfnumber(res, (wxT("\"") + quotedColName + wxT("\"")).mb_str(conv));
     }
     else
         col = PQfnumber(res, colname.mb_str(conv));
