Index: /trunk/ippTools/src/chiptool.c
===================================================================
--- /trunk/ippTools/src/chiptool.c	(revision 6340)
+++ /trunk/ippTools/src/chiptool.c	(revision 6341)
@@ -76,5 +76,5 @@
     // frames from the raw set.  This may not be quiet right as it's
     // possible (likely?) that a rawScienceExp is inserted into the
-    // database prior to /ALL/ of that exposure's Imfiles
+    // dbh prior to /ALL/ of that exposure's Imfiles
     if (pendingFrames) {
         for (int i = 0; i < rawFrames->n; i++) {
@@ -164,13 +164,13 @@
     psArray *doneImfiles = p2pendingToDoneImfile(pendingImfiles);
     for (int i = 0; i < doneImfiles->n; i++) {
-        if (!p2DoneImfileInsertObject(config->database, doneImfiles->data[i])) {
-            psError(PS_ERR_UNKNOWN, false, "database access failed");
+        if (!p2DoneImfileInsertObject(config->dbh, doneImfiles->data[i])) {
+            psError(PS_ERR_UNKNOWN, false, "dbh access failed");
             return false;
         }
     }
     // delete from pending
-    if (p2PendingImfileDeleteRowObjects(config->database, pendingImfiles, MAX_ROWS) < 0) {
+    if (p2PendingImfileDeleteRowObjects(config->dbh, pendingImfiles, MAX_ROWS) < 0) {
         // there must be atleast 1 Imfile to get this far
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         return false;
     }
@@ -188,5 +188,5 @@
         psMetadata *where = psMetadataAlloc();
         psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", pendingExp->exp_id);
-        psArray *pendingImfiles = p2PendingImfileSelectRowObjects(config->database, where, MAX_ROWS);
+        psArray *pendingImfiles = p2PendingImfileSelectRowObjects(config->dbh, where, MAX_ROWS);
         psFree(where)
         if (!pendingImfiles) {
@@ -195,8 +195,8 @@
             nukeMe->n = 0;
             psArrayAdd(nukeMe, 0, pendingExp);
-            bool status = p2PendingExpDeleteRowObjects(config->database, nukeMe, MAX_ROWS);
+            bool status = p2PendingExpDeleteRowObjects(config->dbh, nukeMe, MAX_ROWS);
             psFree(nukeMe);
             if (!status) {
-                psError(PS_ERR_UNKNOWN, false, "database access failed");
+                psError(PS_ERR_UNKNOWN, false, "dbh access failed");
                 return false;
             }
@@ -208,6 +208,6 @@
                 return false;
             }
-            if (!p2DoneExpInsertObject(config->database, doneExp)) {
-                psError(PS_ERR_UNKNOWN, false, "database access failed");
+            if (!p2DoneExpInsertObject(config->dbh, doneExp)) {
+                psError(PS_ERR_UNKNOWN, false, "dbh access failed");
                 return false;
             }
Index: /trunk/ippTools/src/chiptoolConfig.c
===================================================================
--- /trunk/ippTools/src/chiptoolConfig.c	(revision 6340)
+++ /trunk/ippTools/src/chiptoolConfig.c	(revision 6341)
@@ -163,5 +163,5 @@
 
     // define Database handle, if used
-    config->database = pmConfigDB(config->site);
+    config->dbh = pmConfigDB(config->site);
 
     return true;
Index: /trunk/ippTools/src/p2insertPendingFrames.c
===================================================================
--- /trunk/ippTools/src/p2insertPendingFrames.c	(revision 6340)
+++ /trunk/ippTools/src/p2insertPendingFrames.c	(revision 6341)
@@ -19,5 +19,5 @@
         psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", PS_META_REPLACE, "==",
             rawFrame->exposure->exp_id);
-        psArray *exposures = p2PendingExpSelectRowObjects(config->database,
+        psArray *exposures = p2PendingExpSelectRowObjects(config->dbh,
             where, MAX_ROWS);
         psFree(where);
@@ -67,13 +67,13 @@
         }
         
-        if (!p2PendingExpInsertObject(config->database, pendingExposure)) {
-            psError(PS_ERR_UNKNOWN, false, "database access failed");
+        if (!p2PendingExpInsertObject(config->dbh, pendingExposure)) {
+            psError(PS_ERR_UNKNOWN, false, "dbh access failed");
             return false;
         }
 
         for (int i = 0; i < pendingImages->n; i++) {
-            if (!p2PendingImfileInsertObject(config->database,
+            if (!p2PendingImfileInsertObject(config->dbh,
                     pendingImages->data[i])) {
-                psError(PS_ERR_UNKNOWN, false, "database access failed");
+                psError(PS_ERR_UNKNOWN, false, "dbh access failed");
                 return false;
             }
Index: /trunk/ippTools/src/p2searchDoneFrames.c
===================================================================
--- /trunk/ippTools/src/p2searchDoneFrames.c	(revision 6340)
+++ /trunk/ippTools/src/p2searchDoneFrames.c	(revision 6341)
@@ -5,5 +5,5 @@
     PS_ASSERT_PTR_NON_NULL(config, NULL);
 
-    psArray *exposures = p2DoneExpSelectRowObjects(config->database,
+    psArray *exposures = p2DoneExpSelectRowObjects(config->dbh,
         config->where, MAX_ROWS);
     if (!exposures) {
@@ -25,9 +25,9 @@
             exposure->exp_id);
 
-        psArray *images = p2DoneImfileSelectRowObjects(config->database, where,
+        psArray *images = p2DoneImfileSelectRowObjects(config->dbh, where,
             MAX_ROWS);
         psFree(where);
         if (!images) {
-            psError(PS_ERR_UNKNOWN, false, "database access failed");
+            psError(PS_ERR_UNKNOWN, false, "dbh access failed");
 
             return NULL;
Index: /trunk/ippTools/src/p2searchPendingFrames.c
===================================================================
--- /trunk/ippTools/src/p2searchPendingFrames.c	(revision 6340)
+++ /trunk/ippTools/src/p2searchPendingFrames.c	(revision 6341)
@@ -5,5 +5,5 @@
     PS_ASSERT_PTR_NON_NULL(config, NULL);
 
-    psArray *exposures = p2PendingExpSelectRowObjects(config->database,
+    psArray *exposures = p2PendingExpSelectRowObjects(config->dbh,
         config->where, MAX_ROWS);
     if (!exposures) {
@@ -25,5 +25,5 @@
         psMetadataAddS32(where, PS_LIST_TAIL, "p2_version", PS_META_REPLACE, "==", exposure->p2_version);
 
-        psArray *images = p2PendingImfileSelectRowObjects(config->database, where, MAX_ROWS);
+        psArray *images = p2PendingImfileSelectRowObjects(config->dbh, where, MAX_ROWS);
 
         p2PendingFrame *frame = p2PendingFrameAlloc(exposure, images);
@@ -43,5 +43,5 @@
     PS_ASSERT_PTR_NON_NULL(config, NULL);
 
-    psArray *imfiles = p2PendingImfileSelectRowObjects(config->database,
+    psArray *imfiles = p2PendingImfileSelectRowObjects(config->dbh,
         config->where, MAX_ROWS);
     if (!imfiles) {
@@ -58,5 +58,5 @@
     PS_ASSERT_PTR_NON_NULL(config, NULL);
 
-    psArray *exps = p2PendingExpSelectRowObjects(config->database,
+    psArray *exps = p2PendingExpSelectRowObjects(config->dbh,
         config->where,
         MAX_ROWS);
Index: /trunk/ippTools/src/p2updatePending.c
===================================================================
--- /trunk/ippTools/src/p2updatePending.c	(revision 6340)
+++ /trunk/ippTools/src/p2updatePending.c	(revision 6341)
@@ -10,5 +10,5 @@
     // select all of the exposures which are still pending
     psMetadataAddS32 (where, PS_LIST_TAIL, "STATE", 0, "==", PX_MODE_PENDING);
-    psArray *exposures = p2PendingExpSelectRowObjects (config->database, where, MAX_ROWS);
+    psArray *exposures = p2PendingExpSelectRowObjects (config->dbh, where, MAX_ROWS);
 
     // we will now select all of the matching images which are done
@@ -20,5 +20,5 @@
 	psMetadataAddStr (where, PS_LIST_TAIL, "EXP_ID",     PS_META_REPLACE, "==", exposure->exp_id);
 	psMetadataAddS32 (where, PS_LIST_TAIL, "P2_VERSION", PS_META_REPLACE, "==", exposure->p2_version);
-	psArray *images = p2PendingImfileSelectRowObjects (config->database, where, MAX_ROWS);
+	psArray *images = p2PendingImfileSelectRowObjects (config->dbh, where, MAX_ROWS);
 	if (images->n != exposure->imfiles) {
 	    // free things
@@ -28,5 +28,5 @@
 	// XXX add P2 stats here?
 //	exposure->state = PX_MODE_DONE;
-//	p2PendingExposureUpdateRows (config->database, exposure);
+//	p2PendingExposureUpdateRows (config->dbh, exposure);
     }
     return true;
Index: /trunk/ippTools/src/pxadminConfig.c
===================================================================
--- /trunk/ippTools/src/pxadminConfig.c	(revision 6340)
+++ /trunk/ippTools/src/pxadminConfig.c	(revision 6341)
@@ -73,5 +73,5 @@
 
     // define Database handle, if used
-    config->database = pmConfigDB(config->site);
+    config->dbh = pmConfigDB(config->site);
     return true;
 } 
Index: /trunk/ippTools/src/pxconfig.c
===================================================================
--- /trunk/ippTools/src/pxconfig.c	(revision 6340)
+++ /trunk/ippTools/src/pxconfig.c	(revision 6341)
@@ -16,5 +16,5 @@
     config->camera_name     = NULL;
     config->filter          = NULL;
-    config->database        = NULL;
+    config->dbh        = NULL;
     config->site            = NULL;
     config->recipe          = NULL;
@@ -37,5 +37,5 @@
     psFree(config->camera_name);
     psFree(config->filter);
-    psFree(config->database); 
+    psFree(config->dbh); 
     psFree(config->site);
     psFree(config->recipe);
Index: /trunk/ippTools/src/pxframes.c
===================================================================
--- /trunk/ippTools/src/pxframes.c	(revision 6340)
+++ /trunk/ippTools/src/pxframes.c	(revision 6341)
@@ -79,5 +79,5 @@
     PS_ASSERT_PTR_NON_NULL(config, NULL); \
  \
-    psArray *exposures = exptype##SelectRowObjects(config->database, \
+    psArray *exposures = exptype##SelectRowObjects(config->dbh, \
         config->where, MAX_ROWS); \
     if (!exposures) { \
@@ -97,5 +97,5 @@
             exposure->exp_id); \
  \
-        psArray *images = imfiletype##SelectRowObjects(config->database, where, \
+        psArray *images = imfiletype##SelectRowObjects(config->dbh, where, \
             MAX_ROWS); \
         psFree(where); \
@@ -155,11 +155,11 @@
 {
     PS_ASSERT_PTR_NON_NULL(config, false);
-    PS_ASSERT_PTR_NON_NULL(config->database, false);
+    PS_ASSERT_PTR_NON_NULL(config->dbh, false);
     PS_ASSERT_PTR_NON_NULL(frame, false);
 
-    psDB *dbh = config->database;
+    psDB *dbh = config->dbh;
 
     if (!rawScienceExpInsertObject(dbh, frame->exposure)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         return false;
     }
@@ -168,5 +168,5 @@
     for (long i = 0; i < images->n; i++) {
         if (!rawImfileInsertObject(dbh, images->data[i])) {
-            psError(PS_ERR_UNKNOWN, false, "database access failed");
+            psError(PS_ERR_UNKNOWN, false, "dbh access failed");
             return false;
         }
@@ -214,11 +214,11 @@
 {
     PS_ASSERT_PTR_NON_NULL(config, false);
-    PS_ASSERT_PTR_NON_NULL(config->database, false);
+    PS_ASSERT_PTR_NON_NULL(config->dbh, false);
     PS_ASSERT_PTR_NON_NULL(frame, false);
 
-    psDB *dbh = config->database;
+    psDB *dbh = config->dbh;
 
     if (!rawDetrendExpInsertObject(dbh, frame->exposure)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         return false;
     }
@@ -227,5 +227,5 @@
     for (long i = 0; i < images->n; i++) {
         if (!rawImfileInsertObject(dbh, images->data[i])) {
-            psError(PS_ERR_UNKNOWN, false, "database access failed");
+            psError(PS_ERR_UNKNOWN, false, "dbh access failed");
             return false;
         }
Index: /trunk/ippTools/src/pxtables.c
===================================================================
--- /trunk/ippTools/src/pxtables.c	(revision 6340)
+++ /trunk/ippTools/src/pxtables.c	(revision 6341)
@@ -6,54 +6,54 @@
     PS_ASSERT_PTR_NON_NULL(config, false);
 
-    if (!newExpCreateTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!newExpCreateTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!newImfileCreateTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!newImfileCreateTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!rawScienceExpCreateTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!rawScienceExpCreateTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!rawImfileCreateTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!rawImfileCreateTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!rawDetrendExpCreateTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!rawDetrendExpCreateTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!p1PendingExpCreateTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!p1PendingExpCreateTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!p2PendingExpCreateTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!p2PendingExpCreateTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!p2PendingImfileCreateTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!p2PendingImfileCreateTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!p2DoneExpCreateTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!p2DoneExpCreateTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!p2DoneImfileCreateTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!p2DoneImfileCreateTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!p3PendingExpCreateTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!p3PendingExpCreateTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!masterDetrendFramesCreateTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!masterDetrendFramesCreateTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!masterDetrendImfileCreateTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!masterDetrendImfileCreateTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
@@ -77,5 +77,5 @@
     if (strcmp (answer, "YES")) goto escape;
 
-    fprintf (stdout, "enter database connection password: ");
+    fprintf (stdout, "enter dbh connection password: ");
     fgets (line, 128, stdin);
     sscanf (line, "%s", answer);
@@ -88,54 +88,54 @@
     }
 
-    if (!newExpDropTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!newExpDropTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!newImfileDropTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!newImfileDropTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!rawScienceExpDropTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!rawScienceExpDropTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!rawImfileDropTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!rawImfileDropTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!rawDetrendExpDropTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!rawDetrendExpDropTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!p1PendingExpDropTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!p1PendingExpDropTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!p2PendingExpDropTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!p2PendingExpDropTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!p2PendingImfileDropTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!p2PendingImfileDropTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!p2DoneExpDropTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!p2DoneExpDropTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!p2DoneImfileDropTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!p2DoneImfileDropTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!p3PendingExpDropTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!p3PendingExpDropTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!masterDetrendFramesDropTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!masterDetrendFramesDropTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
-    if (!masterDetrendImfileDropTable(config->database)) {
-        psError(PS_ERR_UNKNOWN, false, "database access failed");
+    if (!masterDetrendImfileDropTable(config->dbh)) {
+        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
         status = false;
     }
Index: /trunk/ippTools/src/pxtools.h
===================================================================
--- /trunk/ippTools/src/pxtools.h	(revision 6340)
+++ /trunk/ippTools/src/pxtools.h	(revision 6341)
@@ -36,5 +36,5 @@
     char *camera_name;
     char *filter;
-    psDB *database;
+    psDB *dbh;
     psMetadata *site;
     psMetadata *recipe;
Index: /trunk/ippTools/src/regtool.c
===================================================================
--- /trunk/ippTools/src/regtool.c	(revision 6340)
+++ /trunk/ippTools/src/regtool.c	(revision 6341)
@@ -86,5 +86,5 @@
             psMetadataAddStr(where, PS_LIST_TAIL, "camera", 0, NULL,
                 newFrame->exposure->camera);
-            psArray *configs = p0CameraConfigSelectRowObjects(config->database, where, MAX_ROWS);
+            psArray *configs = p0CameraConfigSelectRowObjects(config->dbh, where, MAX_ROWS);
             psFree(where);
             // if there is no match then we default to sending into into p2
@@ -94,5 +94,5 @@
                     newFrame->exposure
                 );
-                p2PendingExpInsertObject(config->database, p2PendingExp);
+                p2PendingExpInsertObject(config->dbh, p2PendingExp);
                 psFree(p2PendingExp);
                 continue;
@@ -108,5 +108,5 @@
                         newFrame->exposure
                     );
-                    p1PendingExpInsertObject(config->database, p1PendingExp);
+                    p1PendingExpInsertObject(config->dbh, p1PendingExp);
                     psFree(p1PendingExp);
                 }
@@ -118,5 +118,5 @@
                         newFrame->exposure
                     );
-                    p2PendingExpInsertObject(config->database, p2PendingExp);
+                    p2PendingExpInsertObject(config->dbh, p2PendingExp);
                     psFree(p2PendingExp);
                 }
Index: /trunk/ippTools/src/regtoolConfig.c
===================================================================
--- /trunk/ippTools/src/regtoolConfig.c	(revision 6340)
+++ /trunk/ippTools/src/regtoolConfig.c	(revision 6341)
@@ -136,5 +136,5 @@
 
     // define Database handle, if used
-    config->database = pmConfigDB(config->site);
+    config->dbh = pmConfigDB(config->site);
 
     return true;
