r10536: 11 May 2005 Kevin Rosenberg <kevin@rosenberg.net>
[clsql.git] / sql / generic-postgresql.lisp
index cf3fac370c5dfa8c0e0448290b2607f2f4bcf34c..ac01e7ba073ecdfe4d2dcb91039c12796f8d3706 100644 (file)
   (declare (ignore database))
   (if args
       (format nil "CHAR(~A)" (car args))
-      "VARCHAR"))
+    "VARCHAR"))
+
+(defmethod database-get-type-specifier ((type (eql 'tinyint)) args database
+                                       (db-type (eql :postgresql)))
+  (declare (ignore args database))
+  "INT2")
+
+(defmethod database-get-type-specifier ((type (eql 'smallint)) args database
+                                       (db-type (eql :postgresql)))
+  (declare (ignore args database))
+  "INT2")
 
 (defmethod database-get-type-specifier ((type (eql 'wall-time)) args database
                                        (db-type (eql :postgresql)))
          (result
          (mapcar #'car
                  (database-query
-                  (format nil "SELECT attname FROM pg_class,pg_attribute WHERE pg_class.oid=attrelid AND relname='~A'~A"
+                  (format nil "SELECT attname FROM pg_class,pg_attribute WHERE pg_class.oid=attrelid AND attisdropped = FALSE AND relname='~A'~A"
                            (string-downcase table)
                            owner-clause)
                    database nil nil))))