Frequently Asked Questions about psycopg
****************************************

Index
-----

1.   Install problems
1.1  How do I install ZPsycopgDA with a pre-packaged Zope?

2.   Distributions and architectures
2.1  Does psycopg work on Debian GNU/Linux?
2.2  Does psycopg work on RedHat?


Answers
-------

1.1  How do I install ZPsycopgDA with a pre-packaged Zope?

[The answer was written by Julio Monteiro and sent to the psycopg
 mailing list, I just edited it a little bit.]

After installing you pre-packaged version of Zope (and python that
comes bundled to it), get mxDateTime from:

    http://www.egenix.com/files/python/eGenix-mx-Extensions.html

unpack it and then run:

    $ZOPE_HOME/bin/python setup.py install

where $ZOPE_HOME is the directory where you unpacked Zope. This step
install the mxDateTime package in the bundled python directories. Then
download the latest version of psycopg from:

    http://initd.org/software/psycopg

untar it and configure with a command like the following one (all on a
single line and you'll need to adjust the paths accordingly to your
PostgreSQL installation, etc.):

    ./configure --with-python=$ZOPE_HOME/bin/python 
      --with-zope=$ZOPE_HOME 
      --with-mxdatetime-includes=$ZOPE_HOME/lib/python2.1/site-packages/mx/DateTime/mxDateTime 
      --with-postgres-includes=/usr/include/postgresql

You may have a problem like:

    /config.status: /lib/python2.1/config/makesetup: Permission denied

Try giving makesetup exec permissions (Zope does not do it by default.)

Then you will need to modify the Makefile by hand around line 90,
where it sets CFLAGS, just add:

    -I/path/to/zope/include/python2.1/

Then run:

    make
    make install
    make install-zope

after make install, you will have the file 'psycopgmodule.so' located
in your zope root folder. That won't do, so you have to move the file
to $ZOPE_HOME/lib/python2.1/lib-dynload/.

That's all!


2.1  Does psycopg work on Debian GNU/Linux?

Yes, it works both on 2.3 (potato, packages available from psycopg
homepage) and 3.0 (woody, sinply apt-get it from the nearest Debian
mirror.)


2.2  Does psycopg work on RedHat?

There are no official psycopf RPMs, but from 1.0.6 onward the psycopg
distribution include a spec file for building RPM packages. Modify it
with your favourite editor and then issue the build command as
explained in the first lines of the psycopg.spec file.
