Remove CVS $Id$ keyword
[clsql.git] / db-postgresql-socket / postgresql-socket-sql.lisp
index aaa5fcbfc22b7701e57ae9b2904ca8b9af78a116..9183ca463493b27193dc8d3e4a3ac3cd9e375ece 100644 (file)
@@ -7,9 +7,7 @@
 ;;;; Authors:  Kevin M. Rosenberg based on original code by Pierre R. Mai
 ;;;; Created:  Feb 2002
 ;;;;
-;;;; $Id$
-;;;;
-;;;; This file, part of CLSQL, is Copyright (c) 2002-2004 by Kevin M. Rosenberg
+;;;; This file, part of CLSQL, is Copyright (c) 2002-2010 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
 ;;;;
 ;;;; CLSQL users are granted the rights to distribute and use this software
@@ -324,19 +322,21 @@ doesn't depend on UFFI."
             (wait-for-query-results (database-connection database)))))))
 
 (defmethod database-create (connection-spec (type (eql :postgresql-socket)))
-  (destructuring-bind (host name user password) connection-spec
-    (let ((database (database-connect (list host "template1" user password)
+  (destructuring-bind (host name user password &optional port options tty) connection-spec
+    (let ((database (database-connect (list host "postgres" user password)
                                       type)))
+      (setf (slot-value database 'clsql-sys::state) :open)
       (unwind-protect
-           (execute-command (format nil "create database ~A" name))
+           (database-execute-command (format nil "create database ~A" name) database)
         (database-disconnect database)))))
 
 (defmethod database-destroy (connection-spec (type (eql :postgresql-socket)))
-  (destructuring-bind (host name user password) connection-spec
-    (let ((database (database-connect (list host "template1" user password)
+  (destructuring-bind (host name user password &optional port optional tty) connection-spec
+    (let ((database (database-connect (list host "postgres" user password)
                                       type)))
+      (setf (slot-value database 'clsql-sys::state) :open)
       (unwind-protect
-          (execute-command (format nil "drop database ~A" name))
+          (database-execute-command (format nil "drop database ~A" name) database)
         (database-disconnect database)))))