Postgres/es

This is an old revision of Postgres/es, edited by Jma sp at . The current revision is 59615.

New page: == Overview - interface to PostGreSQL == You can use Free Pascal to access a PostGreSQL database server from Linux. (for more info on PostGreSQL, see their home page.) Interfacing is ve...

Overview - interface to PostGreSQL

You can use Free Pascal to access a PostGreSQL database server from Linux. (for more info on PostGreSQL, see their home page.)

Interfacing is very easy, all you need to do is compile some units, and use these units in your program. You need to specify the place of the PostGreSQL client Library (libpq) when compiling, and that is it. the provided units take care of the rest.

The main unit is called postgres, normally this is the only unit you must include in your uses clause.

Requirements

You need at least version 0.99.5 of Free Pascal. The headers are translated from PostGreSQL version 6.3.1. Using an earlier version may not work. Installation The prostgres unit comes with the Free Pascal packages, and is distributed together with the compiler. This contains a directory postgres with the units, a test program and a makefile. cd to the directory and edit the Makefile to set the variables for your system. You must provide only 1 thing:

  1. The directory where the libpq library resides, usually /usr/local/pgsql/lib

Typing

make

Should compile the units and the program. If compilation was succesfull, you can install with

make install

(Remember to set the directory where the units should be installed.)

You can then test the program by running

make test

This will:

You will see a lot of messages on your screen, giving you feedback and results. If something went wrong, make will inform you of this. Future plans The interface to PostGreSQL is a pure translation of the PostGreSQL C header files. This means that the used functions are rather un-pascalish. It would be great to have an OOP interface for it, A la Delphi. This interface is being worked on.

Go to back Packages List