r8998: conditionalize shell command for windows
[clsql.git] / db-postgresql-socket / postgresql-socket-sql.lisp
index c304db07e1204c861cdb86c941224ae21d506e6d..1e29c070d6749dfac59dcc88dde53898c397aff0 100644 (file)
@@ -194,6 +194,7 @@ doesn't depend on UFFI."
                 (make-instance 'postgresql-socket-database
                                :name (database-name-from-spec connection-spec
                                                               database-type)
+                               :database-type :postgresql-socket
                                :connection-spec connection-spec
                                :connection connection)))))
 
@@ -457,5 +458,17 @@ doesn't depend on UFFI."
            t)
        (database-disconnect database)))))
 
+(defmethod database-describe-table ((database postgresql-socket-database) 
+                                   table)
+  (database-query
+   (format nil "select a.attname, t.typname
+                               from pg_class c, pg_attribute a, pg_type t
+                               where c.relname = '~a'
+                                   and a.attnum > 0
+                                   and a.attrelid = c.oid
+                                   and a.atttypid = t.oid"
+           (sql-escape (string-downcase table)))
+   database :auto))
+
 (when (clsql-base-sys:database-type-library-loaded :postgresql-socket)
   (clsql-base-sys:initialize-database-type :database-type :postgresql-socket))