X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Fgeneric-postgresql.lisp;h=cf3fac370c5dfa8c0e0448290b2607f2f4bcf34c;hp=c387f19c41117b2e6af10d06a904fe72775aea3c;hb=fdd069770e32d0cfa4b66d6e5cfd4540197660ba;hpb=bf2c17ae4cb07adab3bbff036228572287936d75 diff --git a/sql/generic-postgresql.lisp b/sql/generic-postgresql.lisp index c387f19..cf3fac3 100644 --- a/sql/generic-postgresql.lisp +++ b/sql/generic-postgresql.lisp @@ -178,7 +178,7 @@ (parse-integer (caar (database-query - (concatenate 'string "SELECT LAST_VALUE ('" sequence-name "')") + (concatenate 'string "SELECT LAST_VALUE FROM " sequence-name) database nil nil))))) (defun postgresql-database-list (connection-spec type) @@ -201,8 +201,12 @@ (defmethod database-list (connection-spec (type (eql :postgresql-socket))) (postgresql-database-list connection-spec type)) - +#+nil (defmethod database-describe-table ((database generic-postgresql-database) table) + ;; MTP: LIST-ATTRIBUTE-TYPES currently executes separate queries for + ;; each attribute. It would be more efficient to have a single SQL + ;; query return the type data for all attributes. This code is + ;; retained as an example of how to do this for PostgreSQL. (database-query (format nil "select a.attname, t.typname from pg_class c, pg_attribute a, pg_type t