Index: trunk/ippTools/src/pzgetexp.c
===================================================================
--- trunk/ippTools/src/pzgetexp.c	(revision 42387)
+++ trunk/ippTools/src/pzgetexp.c	(revision 42412)
@@ -77,4 +77,5 @@
     PXOPT_LOOKUP_S32(timeout, config->args, "-timeout", false, false);
     PXOPT_LOOKUP_BOOL(all, config->args, "-all", false);
+    PXOPT_LOOKUP_BOOL(ignore_errors, config->args, "-ignore-errors", false);
 
     // find last fileset/exp_name (if we have one)
@@ -180,4 +181,5 @@
     }
 
+    // XXX for test, make this not a temporary table:
     // create a temporry table
     {
@@ -197,5 +199,8 @@
 
     {
-        char *query = "INSERT INTO incoming (exp_name, camera, telescope, dateobs, exp_type, uri) VALUES (?, ?, ?, ?, ?, ?)";
+      char *query_notice = "INSERT INTO incoming (exp_name, camera, telescope, dateobs, exp_type, uri) VALUES (?, ?, ?, ?, ?, ?)";
+      char *query_ignore = "INSERT IGNORE INTO incoming (exp_name, camera, telescope, dateobs, exp_type, uri) VALUES (?, ?, ?, ?, ?, ?)";
+
+      char *query = ignore_errors ? query_ignore : query_notice;
 
         long inserted = p_psDBRunQueryPrepared(config->dbh, newSummitExps, query);
@@ -209,4 +214,5 @@
             return false;
         }
+	fprintf (stderr, "inserted: %d\n", (int) inserted);
         // sanity check that we actually inserted something
         if (inserted == 0) {
@@ -222,4 +228,67 @@
 
     psFree(newSummitExps);
+
+    // TEST
+    if (0) {
+	char *query = "select * from incomingTest";
+	p_psDBRunQuery(config->dbh, query);
+        psArray *output = p_psDBFetchResult(config->dbh);
+        if (!output) {
+	    psError(PS_ERR_UNKNOWN, false, "database error");
+	    return false;
+        }
+	
+        // negative simple so the default is true
+        if (!ippdbPrintMetadatas(stdout, output, "test", TRUE)) {
+            psError(PS_ERR_UNKNOWN, false, "failed to print array");
+            psFree(output);
+            return false;
+        }
+        psFree(output);
+	exit (2);
+    }
+
+    // debug this query
+    if (0) {
+        char *query = 
+            "DESCRIBE INSERT INTO summitExp" 
+            "   SELECT"
+  	    "       NULL," // summit_id
+            "       incomingTest.*,"
+            "       NULL,"  // imfiles
+            "       0,"     // fault
+            "       NULL"   // epoch
+            "   FROM incomingTest"
+            "   LEFT JOIN summitExp"
+            "       USING(exp_name, camera, telescope)"
+            "   WHERE"
+            "       summitExp.exp_name is NULL"
+            "       AND summitExp.camera is NULL"
+            "       AND summitExp.telescope is NULL";
+
+        if (!p_psDBRunQuery(config->dbh, query)) {
+            // rollback
+            if (!psDBRollback(config->dbh)) {
+                psError(PS_ERR_UNKNOWN, false, "database error");
+            }
+            psError(PS_ERR_UNKNOWN, false, "database error");
+            return false;
+        }
+        psArray *output = p_psDBFetchResult(config->dbh);
+        if (!output) {
+	    psError(PS_ERR_UNKNOWN, false, "database error");
+	    return false;
+        }
+	
+        // negative simple so the default is true
+        if (!ippdbPrintMetadatas(stdout, output, "test", TRUE)) {
+            psError(PS_ERR_UNKNOWN, false, "failed to print array");
+            psFree(output);
+            return false;
+        }
+        psFree(output);
+    }
+
+    // exit  (1);
 
     // add new exps to summitExp
@@ -239,5 +308,9 @@
             "       summitExp.exp_name is NULL"
             "       AND summitExp.camera is NULL"
-            "       AND summitExp.telescope is NULL";
+	    "       AND summitExp.telescope is NULL";
+
+	// MAJOR hack to avoid excess long inserts
+	// include this line to limit the incomping entries
+	// "       AND incoming.dateobs > '2023-01-01'";
 
         if (!p_psDBRunQuery(config->dbh, query)) {
