X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=db-postgresql-socket3%2Fapi.lisp;h=ad6ca1878f92cb524c96513b727218065b470d67;hb=814ef0649edf23f0136d5cad2d7738ae72e79871;hp=8fa690cf20006c9b3805b44c64d9827a27814117;hpb=126812fb21eeb397865ebd1f4cfaf13ca5b350f3;p=clsql.git diff --git a/db-postgresql-socket3/api.lisp b/db-postgresql-socket3/api.lisp index 8fa690c..ad6ca18 100644 --- a/db-postgresql-socket3/api.lisp +++ b/db-postgresql-socket3/api.lisp @@ -23,7 +23,42 @@ t) (defmethod clsql-sys:database-type-library-loaded ((database-type - (eql :postgresql-socket))) + (eql :postgresql-socket3))) "T if foreign library was able to be loaded successfully. Always true for socket interface" - t) \ No newline at end of file + t) + +(defparameter +postgresql-server-default-port+ 5432 + "Default port of PostgreSQL server.") + +;;;; Condition hierarchy + +(define-condition postgresql-condition (condition) + ((connection :initarg :connection :reader postgresql-condition-connection) + (message :initarg :message :reader postgresql-condition-message)) + (:report + (lambda (c stream) + (format stream "~@<~A occurred on connection ~A. ~:@_Reason: ~A~:@>" + (type-of c) + (postgresql-condition-connection c) + (postgresql-condition-message c))))) + +(define-condition postgresql-error (error postgresql-condition) + ()) + +(define-condition postgresql-fatal-error (postgresql-error) + ()) + +(define-condition postgresql-login-error (postgresql-fatal-error) + ()) + +(define-condition postgresql-warning (warning postgresql-condition) + ()) + +(define-condition postgresql-notification (postgresql-condition) + () + (:report + (lambda (c stream) + (format stream "~@" + (postgresql-condition-connection c) + (postgresql-condition-message c))))) \ No newline at end of file