Index: trunk/ippTools/src/releasetool.c
===================================================================
--- trunk/ippTools/src/releasetool.c	(revision 35213)
+++ trunk/ippTools/src/releasetool.c	(revision 35214)
@@ -1056,5 +1056,5 @@
 
     PXOPT_LOOKUP_STR(group_type, config->args, "-set_group_type", true, false);
-    PXOPT_LOOKUP_STR(group_name, config->args, "-set_group_name", true, false);
+    PXOPT_LOOKUP_STR(group_name, config->args, "-set_group_name", false, false);
     PXOPT_LOOKUP_STR(label, config->args,     "-set_label", true, false);
 
@@ -1071,4 +1071,9 @@
     if (!strcmp(group_type, "lap")) {
         type_lap = true;
+        if (group_name) {
+            psError(PXTOOLS_ERR_CONFIG, true, "group_name is not allowed with group_type lap");
+            psFree(where);
+            return false;
+        }
         PXOPT_COPY_S64(config->args, where, "-select_seq_id", "lapRun.seq_id", "==");
         PXOPT_COPY_S64(config->args, where, "-select_lap_id", "lapRun.lap_id", "==");
@@ -1086,4 +1091,9 @@
         } else {
             psError(PXTOOLS_ERR_CONFIG, true, "%s is not valid group_type", group_type);
+            return false;
+        }
+        if (!group_name) {
+            psError(PXTOOLS_ERR_CONFIG, true, "group_name is required allowed with group_type %s", group_type);
+            psFree(where);
             return false;
         }
@@ -1310,54 +1320,21 @@
 static bool pendingrelgroupMode(pxConfig *config)
 {
-    psError(PS_ERR_UNKNOWN, true, "not yet implemented");
-    return false;
-#ifdef notdef
     PS_ASSERT_PTR_NON_NULL(config, NULL);
 
     psMetadata *where = psMetadataAlloc();
 
-    pxAddLabelSearchArgs (config, where, "-label", "relGroup.label", "==");
-
-    PXOPT_COPY_S64(config->args, where, "-relexp_id",   "relExp.relexp_id", "==");
+    pxAddLabelSearchArgs (config, where, "-label",      "relGroup.label", "==");
+    PXOPT_COPY_S32(config->args, where, "-group_id",    "relGroup.group_id", "==");
+    PXOPT_COPY_S32(config->args, where, "-rel_id",      "relExp.rel_id", "==");
     PXOPT_COPY_STR(config->args, where, "-release_name", "ippRelease.release_name", "LIKE");
-#ifdef notdef
-    PXOPT_COPY_S32(config->args, where, "-rel_id",      "relExp.rel_id", "==");
-    pxAddLabelSearchArgs(config, where, "-release_state","ippRelease.state", "==");
-    PXOPT_COPY_STR(config->args, where, "-state",       "relExp.state", "==");
-    PXOPT_COPY_STR(config->args, where, "-filter",      "rawExp.filter", "LIKE");
-    PXOPT_COPY_TIME(config->args, where, "-dateobs_begin","rawExp.dateobs", ">=");
-    PXOPT_COPY_TIME(config->args, where, "-dateobs_end", "rawExp.dateobs", "<=");
-    PXOPT_COPY_F32(config->args, where, "-fwhm_min",    "camProcessedExp.fwhm_major", ">=");
-    PXOPT_COPY_F32(config->args, where, "-fwhm_max",    "camProcessedExp.fwhm_major", "<=");
-    PXOPT_COPY_STR(config->args, where, "-exp_name",    "rawExp.exp_name", "==");
-    PXOPT_COPY_S64(config->args, where, "-exp_id",      "relExp.exp_id", "==");
-    PXOPT_COPY_S64(config->args, where, "-chip_id",     "relExp.chip_id", "==");
-    PXOPT_COPY_S64(config->args, where, "-cam_id",      "relExp.cam_id", "==");
-    PXOPT_COPY_S64(config->args, where, "-warp_id",     "warpRun.warp_id", "==");
-    PXOPT_COPY_STR(config->args, where, "-chip_data_group", "chipRun.data_group", "LIKE");
-    PXOPT_COPY_STR(config->args, where, "-cam_data_group",  "camRun.data_group", "LIKE");
-    PXOPT_COPY_STR(config->args, where, "-warp_data_group", "warpRun.data_group", "LIKE");
-
-    PXOPT_COPY_STR(config->args, where, "-surveyName",  "survey.surveyName", "LIKE");
-
-    PXOPT_LOOKUP_BOOL(priority_order, config->args, "-priority_order", false);
-#endif
 
     PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
 
-    psString query = pxDataGet("releasetool_tocalibexp.sql");
+    psString query = pxDataGet("releasetool_pendingrelgroup.sql");
     if (!query) {
         psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
         return false;
     }
-
-    psString where2 = NULL;
-#ifdef notdef
-    if (!pxspaceAddWhere(config, &where2, "rawExp")) {
-        psError(psErrorCodeLast(), false, "pxspaceAddWhere failed");
-        return false;
-    }
-#endif
 
     if (psListLength(where->list)) {
@@ -1365,17 +1342,8 @@
         psStringAppend(&query, "\nAND %s", whereClause);
         psFree(whereClause);
-#ifdef notdef
-    } else if (where2) {
-        psStringAppend(&query, "\nAND ");
-#endif
     } else {
         psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required\n");
         psFree(where);
         return false;
-    }
-
-    if (where2) {
-        psStringAppend(&query, "\n%s", where2);
-        psFree(where2);
     }
 
@@ -1405,5 +1373,5 @@
     }
 
-    if (!ippdbPrintMetadatas(stdout, output, "relExp", !simple)) {
+    if (!ippdbPrintMetadatas(stdout, output, "pending_relGroup", !simple)) {
         psError(PS_ERR_UNKNOWN, false, "failed to print array");
         psFree(output);
@@ -1414,5 +1382,4 @@
 
     return true;
-#endif // notdef
 }
 
