X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=db-postgresql-socket%2Fpostgresql-socket-sql.lisp;h=9183ca463493b27193dc8d3e4a3ac3cd9e375ece;hb=d2d49ab13c98bc7a1819a0fd3968268a5567bdc3;hp=aaa5fcbfc22b7701e57ae9b2904ca8b9af78a116;hpb=e567409d9fff3f7231c2a0bb69b345e19de2b246;p=clsql.git diff --git a/db-postgresql-socket/postgresql-socket-sql.lisp b/db-postgresql-socket/postgresql-socket-sql.lisp index aaa5fcb..9183ca4 100644 --- a/db-postgresql-socket/postgresql-socket-sql.lisp +++ b/db-postgresql-socket/postgresql-socket-sql.lisp @@ -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)))))