syntax.xml update from hudson build on Thu 28 Aug 2008 09:25:08 PM CDT
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / adapters / PostgresAdapter.java
index 90bf17f..c31b5fe 100644 (file)
@@ -54,19 +54,20 @@ public class PostgresAdapter extends DatabaseAdapter {
        }
 
        public String getTableQuery(String table) {
-               return "SELECT OID, * FROM " + filterTableName(table); //$NON-NLS-1$
+               return "SELECT * FROM " + filterTableName(table); //$NON-NLS-1$
        }
     /**
      * @see com.quantum.adapters.DatabaseAdapter#filterTableName(java.lang.String)
      */
     public String filterTableName(String tableName) {
         // If there is no mixed case, better not quote, it's prettier on display
-        if (tableName.equals(tableName.toUpperCase())) return tableName;
-        // We quote the table name (and only the table name) because it has mixed case
+       // Postgresql defaults to lower case identifiers
+        if (tableName.equals(tableName.toLowerCase())) return tableName;
+        // We quote the table name because it has mixed case
         if (QuantumUtil.getSchemaName(tableName).equals("")) {
-            return "\"" + tableName +"\""; //$NON-NLS-1$
+            return "\"" + tableName + "\""; //$NON-NLS-1$
         } else {
-            return QuantumUtil.getSchemaName(tableName) + ".\"" + 
+            return "\"" + QuantumUtil.getSchemaName(tableName) + "\".\"" + 
                     QuantumUtil.getTableName(tableName) + "\"";
         }
     }