Index: trunk/psLib/src/db/psDB.c
===================================================================
--- trunk/psLib/src/db/psDB.c	(revision 9030)
+++ trunk/psLib/src/db/psDB.c	(revision 9178)
@@ -12,6 +12,6 @@
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.93 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-09-28 23:21:33 $
+ *  @version $Revision: 1.94 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-04 03:11:52 $
  *
  *  Copyright (C) 2005-2006  Joshua Hoblitt, University of Hawaii
@@ -1316,5 +1316,7 @@
     // look for regular keys
     while ((item = psListGetAndIncrement(cursor))) {
-        if (strstr(item->comment, "Key")) {
+        // it's just a regular key if it matchs "Key" but not "Primary Key"
+        if (strstr(item->comment, "Key")
+                && (!strstr(item->comment, "Primary Key"))) {
             psStringAppend(&query, ", KEY(%s)", item->name);
         } else if (strstr(item->comment, "AUTO_INCREMENT")) {
