Index: error-handling/src/odbc/odbc-functions.lisp
===================================================================
--- error-handling/src/odbc/odbc-functions.lisp	(revision error-handling,3)
+++ error-handling/src/odbc/odbc-functions.lisp	(revision error-handling,4)
@@ -120,5 +120,15 @@
   (:report print-odbc-error))
 
+(define-condition odbc-not-null-violation (odbc-error) ())
+
 (define-condition odbc-foreign-key-error (odbc-error) ())
+
+(define-condition odbc-unique-violation (odbc-error) ())
+
+(define-condition odbc-check-violation (odbc-error) ())
+
+(define-condition odbc-insufficient-privilege (odbc-error) ())
+
+(define-condition odbc-undefined-object (odbc-error) ())
 
 (defun read-and-throw-error (henv hdbc hstmt)
@@ -127,5 +137,10 @@
                     (or hdbc (cffi:null-pointer))
                     (or hstmt (cffi:null-pointer)))
-    (let ((type (cdr (assoc sql-state '(("23503" . odbc-foreign-key-error))
+    (let ((type (cdr (assoc sql-state '(("23502" . odbc-not-null-violation)
+                                        ("23503" . odbc-foreign-key-error)
+                                        ("23505" . odbc-unique-violation)
+                                        ("23514" . odbc-check-violation)
+                                        ("42501" . odbc-insufficient-privilege)
+                                        ("42704" . odbc-undefined-object))
                             :test #'string=))))
       (error (if type type 'odbc-error)
Index: error-handling/src/odbc/plain-odbc-package.lisp
===================================================================
--- error-handling/src/odbc/plain-odbc-package.lisp	(revision error-handling,3)
+++ error-handling/src/odbc/plain-odbc-package.lisp	(revision error-handling,4)
@@ -13,5 +13,12 @@
   (:export
    "ODBC-ERROR"
-   "ODBC-FOREIGN-KEY-ERROR"
+   "ERROR-MESSAGE"
+   "ERROR-CODE"
+   "ODBC-NOT-NULL-VIOLATION"
+   "ODBC-FOREIGN-KEY-VIOLATION"
+   "ODBC-UNIQUE-VIOLATION"
+   "ODBC-CHECK-VIOLATION"
+   "ODBC-INSUFFICIENT-PRIVILEGE"
+   "ODBC-UNDEFINED-OBJECT"
 
    "EXEC-QUERY" 
