Chapter 10. Lisp Programming Interface

pg.el is a socket-level interface to Postgres for emacs.

Author: Written by Eric Marsden on 1999-07-21

pg.el is a socket-level interface to Postgres for emacs (text editor extraordinaire). The module is capable of type coercions from a range of SQL types to the equivalent Emacs Lisp type. It currently supports neither crypt or Kerberos authentication, nor large objects.

The code (version 0.2) is available under GNU GPL from Eric Marsden

Changes since last release:

Please note that this is a programmer's API, and doesn't provide any form of user interface. Example:

 (defun demo ()
    (interactive)
    (let* ((conn (pg:connect "template1" "postgres" "postgres"))
           (res (pg:exec conn "SELECT * from scshdemo WHERE a = 42")))
      (message "status is %s"   (pg:result res :status))
      (message "metadata is %s" (pg:result res :attributes))
      (message "data is %s"     (pg:result res :tuples))
      (pg:disconnect conn)))