X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Fgeneric-postgresql.lisp;h=cf3fac370c5dfa8c0e0448290b2607f2f4bcf34c;hb=d0b5c8c2a14929792d2d5818b57db27cae4484b2;hp=c387f19c41117b2e6af10d06a904fe72775aea3c;hpb=635fd6df23f5cdc0247ec93dfdb04e1be670412e;p=clsql.git 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