The only non portable code is the use of SOCKET-CONNECT. Versions are provided for CMU Common Lisp (CMUCL), SBCL, OpenMCL, CLISP, LispWorks and Allegro Common Lisp (ACL). Corman CL doesn't support binary I/O on socket streams, so it doesn't work there.
Pg is available under the GNU LGPL licence from www.chez.com/emarsden/downloads. There are also Emacs Lisp and scsh versions of the library.
Download ASDF package from http://common-lisp.net/cgi-bin/viewcvs.cgi/root.tar.gz?root=pg&view=tar
This is a snapshot of the CVS repository at common-lisp.net/project/pg and it is not GPG signed.
Here is the last released version, but it's quite old:
http://www.chez.com/emarsden/downloads/pg-dot-lisp-0.19.tar.gz
Sample code:
(with-pg-connection (conn "testdb" "login" :host "dbhost" :password "secret")
(with-pg-transaction conn
(when (member "test_date" (pg-tables conn) :test #'string=)
(pg-exec conn "DROP TABLE test_date"))
(pg-exec conn "CREATE TABLE test_date(a timestamp, b abstime, c time, d date)")
(pg-exec conn "INSERT INTO test_date VALUES "
"(current_timestamp, 'now', 'now', 'now')")))
This page is linked from: Changes In Winter 2000-2001 cirCLe
CLiki pages can be edited by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively