1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
5 ;;;; Name: postgresql-socket-api.lisp
6 ;;;; Purpose: Low-level PostgreSQL interface using sockets
7 ;;;; Authors: Kevin M. Rosenberg based on original code by Pierre R. Mai
12 ;;;; This file, part of CLSQL, is Copyright (c) 2002-2004 by Kevin M. Rosenberg
13 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
15 ;;;; CLSQL users are granted the rights to distribute and use this software
16 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
17 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
18 ;;;; *************************************************************************
20 (in-package #:postgresql-socket3)
22 (defmethod clsql-sys:database-type-load-foreign ((database-type (eql :postgresql-socket3)))
25 (defmethod clsql-sys:database-type-library-loaded ((database-type
26 (eql :postgresql-socket3)))
27 "T if foreign library was able to be loaded successfully. Always true for
31 (defparameter +postgresql-server-default-port+ 5432
32 "Default port of PostgreSQL server.")
34 ;;;; Condition hierarchy
36 (define-condition postgresql-condition (condition)
37 ((connection :initarg :connection :reader postgresql-condition-connection)
38 (message :initarg :message :reader postgresql-condition-message))
41 (format stream "~@<~A occurred on connection ~A. ~:@_Reason: ~A~:@>"
43 (postgresql-condition-connection c)
44 (postgresql-condition-message c)))))
46 (define-condition postgresql-error (error postgresql-condition)
49 (define-condition postgresql-fatal-error (postgresql-error)
52 (define-condition postgresql-login-error (postgresql-fatal-error)
55 (define-condition postgresql-warning (warning postgresql-condition)
58 (define-condition postgresql-notification (postgresql-condition)
62 (format stream "~@<Asynchronous notification on connection ~A: ~:@_~A~:@>"
63 (postgresql-condition-connection c)
64 (postgresql-condition-message c)))))