Postgres: OCaml bindings for PostgreSQL
Copyright (C) 2001  Alain Frisch         <Alain.Frisch@ens.fr>

The library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License; see the file LGPL.

Other files, including the examples, are public domain.

===========================================================================

PostgreSQL (http://www.postgresql.org) is well-known open
source Relational Database Managment System (RDBMS); client
applications for PostgreSQL can be written in a number of languages.
This library allows programmers to write clients in OCaml.
It is mainly a set of bindings for the libpq (libpq is a low-level
C interface to write PostgreSQL clients in C; it is included
in the standard PostgreSQL distribution and libraries for
other languages usually rely on it).


There is no documentation. Sources of information are:
- the manuals included in the PostgreSQL distribution for 
  the basics about libpq and Large Objects
- postgres.mli
- the examples in the subdirectory tests/


Usage of low-level bindings (see postgres.mli) is discouraged.
You should use the OO-encapusalution which provides basic
runtime checks and raises exceptions to signal errors.


The library was developped with:
- OCaml 3.01
- PostgreSQL 7.1.2

It has been tested with PostgreSQL 7.0.2

===========================================================================
Building and installing

Before building the library, you probably need to fix the
POSTGRES_INCLUDE declaration in Makefile. The default
/usr/include/pgsql is correct for Redhat/Mandrake RPM installations.

To build the library:
make all

To install the library as a findlib package:
make install

(you may need to "su" to the unix account with write permission
on the findlib's site-lib/ directory)

A few examples can be found in the subdirectory tests/.
You don't need to install the library to use them.
One of them requires LablGTK 1.2


Once the package is installed, you can use something like:
  
(compilation)
ocamlfind ocamlc -c -package postgres my_prog.ml

(link)
ocamlfind ocamlc -o my_prog -package postgres -linkpkg my_prog.cmo

Or the same with ocamlopt.


You can also build a custom toplevel to use the package interactively:

(build the toplevel)
ocamlfind ocamlmktop -o postgres_top -linkpkg -package postgres

(invoque the toplevel)
./postgres_top -I `ocamlfind query postgres`




===========================================================================
Contacting the author

For any feedback (suggestion, bug report, whatever ...), feel free
to contact the author of the package:

Alain.Frisch@ens.fr


The homepage for the package is:
http://www.eleves.ens.fr:8080/home/frisch/soft
