Index: trunk/ippTools/src/staticskytool.c
===================================================================
--- trunk/ippTools/src/staticskytool.c	(revision 31680)
+++ trunk/ippTools/src/staticskytool.c	(revision 31681)
@@ -128,4 +128,5 @@
     PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false);
     PXOPT_LOOKUP_BOOL(check_inputs, config->args, "-check_inputs", false);
+    PXOPT_LOOKUP_BOOL(rerun, config->args, "-rerun", false);
 
     psString select = pxDataGet("staticskytool_definebyquery_select.sql");
@@ -149,5 +150,10 @@
     psFree(whereMD);
 
-    if (!p_psDBRunQueryF(config->dbh, select, where, num_filter)) {
+    psString make_unique = NULL;
+    if (!rerun) {
+        psStringAppend(&make_unique, "\nAND sky_id IS NULL");
+    }
+
+    if (!p_psDBRunQueryF(config->dbh, select, where, where, num_filter, make_unique ? make_unique : "")) {
         psError(PS_ERR_UNKNOWN, false, "database error");
         psFree(select);
@@ -155,4 +161,5 @@
     }
     psFree(select);
+    psFree(make_unique);
 
     // we now have a list of (tess_id, skycell_id) that (potentially) meet out needs
Index: trunk/ippTools/src/staticskytoolConfig.c
===================================================================
--- trunk/ippTools/src/staticskytoolConfig.c	(revision 31680)
+++ trunk/ippTools/src/staticskytoolConfig.c	(revision 31681)
@@ -61,4 +61,5 @@
     psMetadataAddStr(definebyqueryArgs,  PS_LIST_TAIL, "-set_reduction", 0, "define reduction", NULL);
     psMetadataAddTime(definebyqueryArgs, PS_LIST_TAIL, "-set_registered", 0, "time detrend run was registered", now);
+    psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-rerun",  0, "queue new run even if one already exists for inputs", false);
     psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-pretend",  0, "do not actually modify the database", false);
     psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-check_inputs",  0, "list inputs, do not modify database", false);
