Index: /trunk/psLib/src/dataIO/psDB.c
===================================================================
--- /trunk/psLib/src/dataIO/psDB.c	(revision 3848)
+++ /trunk/psLib/src/dataIO/psDB.c	(revision 3849)
@@ -12,6 +12,6 @@
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-04-06 01:12:58 $
+ *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-05 21:11:39 $
  *
  *  Copyright 2005 Joshua Hoblitt, University of Hawaii
@@ -625,11 +625,5 @@
         } else {
             column = psDBSelectColumnNum(dbh, tableName, field[i].name, pType, 0);
-            if (pType == PS_META_S32) {
-                psMetadataAddS32(table, 0, field[i].name, "", (psS32)atoll(column));
-            } else if (pType == PS_META_F32) {
-                psMetadataAddF32(table, 0, field[i].name, "", (psF32)atof(column));
-            } else if (pType == PS_META_F64) {
-                psMetadataAddF64(table, 0, field[i].name, "", (psF64)atof(column));
-            }
+            psMetadataAddVector(table, 0, field[i].name, "", column);
             psFree(column);
         }
@@ -814,9 +808,5 @@
             // convert NaNs to NULL and set the buffer_length for strings
             //} else if ((item->type == PS_META_STR) && (item->pType == PS_TYPE_PTR)) {
-        } else if ((item->type == PS_META_STR)         || (item->type == PS_META_VEC)    ||
-                   (item->type == PS_META_IMG)         || (item->type == PS_META_HASH)   ||
-                   (item->type == PS_META_LOOKUPTABLE) || (item->type == PS_META_JPEG)   ||
-                   (item->type == PS_META_PNG)         || (item->type == PS_META_ASTROM) ||
-                   (item->type == PS_META_UNKNOWN)) {
+        } else if (item->type == PS_META_STR) {
 
             bind[i].buffer_length = (unsigned long)strlen((char *)item->data.V);
@@ -828,6 +818,7 @@
         } else {
             psError(PS_ERR_BAD_PARAMETER_TYPE , true,
-                    "FIXME: Only type of PS_TYPE_S32, PS_TYPE_F32, PS_TYPE_F64, "
-                    "and PS_TYPE_PTR are supported.");
+                    "FIXME: Only type of PS_TYPE_S32 (PS_META_S32), "
+                    "PS_TYPE_F32 (PS_META_F32), PS_TYPE_F64 (PS_META_F64), "
+                    "and PS_META_STR are supported.");
 
             psFree(cursor);
@@ -874,9 +865,5 @@
             psStringAppend(&query, "%s %s", item->name, colType);
             psFree(colType);
-        } else if ((item->type == PS_META_STR)         || (item->type == PS_META_VEC)    ||
-                   (item->type == PS_META_IMG)         || (item->type == PS_META_HASH)   ||
-                   (item->type == PS_META_LOOKUPTABLE) || (item->type == PS_META_JPEG)   ||
-                   (item->type == PS_META_PNG)         || (item->type == PS_META_ASTROM) ||
-                   (item->type == PS_META_UNKNOWN)) {
+        } else if (item->type == PS_META_STR) {
             // + column name + _ + varchar( + length + )
             psStringAppend(&query, "%s VARCHAR(%s)", item->name, item->data.V);
@@ -884,5 +871,5 @@
             psError(PS_ERR_BAD_PARAMETER_TYPE, true,
                     "FIXME: Only type of PS_META_S32, PS_META_F32, PS_META_F64, "
-                    "and PS_META_* pointer types are supported, (not %d).", item->type);
+                    "and PS_META_STR are supported, (not %d).", item->type);
 
             psFree(query);
@@ -1268,5 +1255,5 @@
         psDBAddToLookupTable(lookupTable, PS_TYPE_C64, "PS_TYPE_C64 is not supported");
         psDBAddToLookupTable(lookupTable, PS_TYPE_BOOL,"BOOLEAN");
-        psDBAddToLookupTable(lookupTable, PS_META_STR, "BLOB");
+        psDBAddToLookupTable(lookupTable, PS_META_STR, "VARCHAR");
     }
 
@@ -1306,13 +1293,10 @@
         while ((key = psListGetAndIncrement(cursor))) {
             value = psHashLookup(psToSQLTable, key);
-            if (!strcmp(value, "BLOB")) {
-                continue; // ignore reverse BLOB mapping, fill in below
-            }
             // switch key and value
             psHashAdd(lookupTable, value, key);
         }
 
+        // Add BLOB & TEXT reverse mappings
         value = psDBIntToString((psU64)PS_META_STR);
-        psHashAdd(lookupTable, "VARCHAR", value);
         psHashAdd(lookupTable, "BLOB",    value);
         psHashAdd(lookupTable, "TEXT",    value);
Index: /trunk/psLib/src/db/psDB.c
===================================================================
--- /trunk/psLib/src/db/psDB.c	(revision 3848)
+++ /trunk/psLib/src/db/psDB.c	(revision 3849)
@@ -12,6 +12,6 @@
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-04-06 01:12:58 $
+ *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-05-05 21:11:39 $
  *
  *  Copyright 2005 Joshua Hoblitt, University of Hawaii
@@ -625,11 +625,5 @@
         } else {
             column = psDBSelectColumnNum(dbh, tableName, field[i].name, pType, 0);
-            if (pType == PS_META_S32) {
-                psMetadataAddS32(table, 0, field[i].name, "", (psS32)atoll(column));
-            } else if (pType == PS_META_F32) {
-                psMetadataAddF32(table, 0, field[i].name, "", (psF32)atof(column));
-            } else if (pType == PS_META_F64) {
-                psMetadataAddF64(table, 0, field[i].name, "", (psF64)atof(column));
-            }
+            psMetadataAddVector(table, 0, field[i].name, "", column);
             psFree(column);
         }
@@ -814,9 +808,5 @@
             // convert NaNs to NULL and set the buffer_length for strings
             //} else if ((item->type == PS_META_STR) && (item->pType == PS_TYPE_PTR)) {
-        } else if ((item->type == PS_META_STR)         || (item->type == PS_META_VEC)    ||
-                   (item->type == PS_META_IMG)         || (item->type == PS_META_HASH)   ||
-                   (item->type == PS_META_LOOKUPTABLE) || (item->type == PS_META_JPEG)   ||
-                   (item->type == PS_META_PNG)         || (item->type == PS_META_ASTROM) ||
-                   (item->type == PS_META_UNKNOWN)) {
+        } else if (item->type == PS_META_STR) {
 
             bind[i].buffer_length = (unsigned long)strlen((char *)item->data.V);
@@ -828,6 +818,7 @@
         } else {
             psError(PS_ERR_BAD_PARAMETER_TYPE , true,
-                    "FIXME: Only type of PS_TYPE_S32, PS_TYPE_F32, PS_TYPE_F64, "
-                    "and PS_TYPE_PTR are supported.");
+                    "FIXME: Only type of PS_TYPE_S32 (PS_META_S32), "
+                    "PS_TYPE_F32 (PS_META_F32), PS_TYPE_F64 (PS_META_F64), "
+                    "and PS_META_STR are supported.");
 
             psFree(cursor);
@@ -874,9 +865,5 @@
             psStringAppend(&query, "%s %s", item->name, colType);
             psFree(colType);
-        } else if ((item->type == PS_META_STR)         || (item->type == PS_META_VEC)    ||
-                   (item->type == PS_META_IMG)         || (item->type == PS_META_HASH)   ||
-                   (item->type == PS_META_LOOKUPTABLE) || (item->type == PS_META_JPEG)   ||
-                   (item->type == PS_META_PNG)         || (item->type == PS_META_ASTROM) ||
-                   (item->type == PS_META_UNKNOWN)) {
+        } else if (item->type == PS_META_STR) {
             // + column name + _ + varchar( + length + )
             psStringAppend(&query, "%s VARCHAR(%s)", item->name, item->data.V);
@@ -884,5 +871,5 @@
             psError(PS_ERR_BAD_PARAMETER_TYPE, true,
                     "FIXME: Only type of PS_META_S32, PS_META_F32, PS_META_F64, "
-                    "and PS_META_* pointer types are supported, (not %d).", item->type);
+                    "and PS_META_STR are supported, (not %d).", item->type);
 
             psFree(query);
@@ -1268,5 +1255,5 @@
         psDBAddToLookupTable(lookupTable, PS_TYPE_C64, "PS_TYPE_C64 is not supported");
         psDBAddToLookupTable(lookupTable, PS_TYPE_BOOL,"BOOLEAN");
-        psDBAddToLookupTable(lookupTable, PS_META_STR, "BLOB");
+        psDBAddToLookupTable(lookupTable, PS_META_STR, "VARCHAR");
     }
 
@@ -1306,13 +1293,10 @@
         while ((key = psListGetAndIncrement(cursor))) {
             value = psHashLookup(psToSQLTable, key);
-            if (!strcmp(value, "BLOB")) {
-                continue; // ignore reverse BLOB mapping, fill in below
-            }
             // switch key and value
             psHashAdd(lookupTable, value, key);
         }
 
+        // Add BLOB & TEXT reverse mappings
         value = psDBIntToString((psU64)PS_META_STR);
-        psHashAdd(lookupTable, "VARCHAR", value);
         psHashAdd(lookupTable, "BLOB",    value);
         psHashAdd(lookupTable, "TEXT",    value);
