Psycopg 2.3.1 released

Posted by Daniele Varrazzo on December 4, 2010
Tagged as news, release


just released Psycopg 2.3.1. No new feature since release 2.3.0: the only fix is for a build issue on CentOS 5.5 x86_64 (ticket #23).

Download URLs:


Comments (9 posted).

Comment #1
Dec. 8, 2010, 4:08 a.m.

Hi, my system is CentOS release 5.5 (Final), but still got "error: command 'gcc' failed with exit status 1" error, I didn`t change any settings, just use "python install", could you give me any advice? Thanks!

Comment #2
Daniele Varrazzo
Dec. 8, 2010, 9:19 a.m.

The real error should be in some of the output line above: you are probably missing some of the development packages:

  • python-devel (for your Python version)
  • postgresql-devel (the higher the better: 8.4 is available in the base RPMs).
  • gcc is to be installed as well.

With these three packages psycopg2 compiles (and passes all the tests) on a freshly installed CentOS 5.5.

Comment #3
Dec. 8, 2010, 10:44 a.m.

The server really didn`t install devel package, it works now!Thanks very much!

Comment #4
Dec. 9, 2010, 10:26 a.m.

On Centos 5.5 I have trouble installing with PostgreSQL 9.0 (installed using yum from PostgreSQL yum repository). I have installed postgresql90-devel libs tool.

While trying to install psycopg2 2.3.1 using easy_install, gcc complains about missing libpq-fe.h.

I have this file in /usr/pgsql-9.0/include/. Should psycopg2 installer know about this location?


Comment #5
Daniele Varrazzo
Dec. 9, 2010, 10:47 a.m.


Yes, when you have PostgreSQL installed in a non-standard location, or you have several versions installed, you should specify which libs and includes to use.

This is done very easily by specifying the path of the pg_config binary, from which the setup reads all the relevant values. In your case it should be in /usr/pgsql-9.0/bin/pg_config.

You can specify the pg_config full path either editing the setup.cfg file or with a command line option of the build_ext command: using something like:

python build_ext --pg-config /path/to/pg_config build

to build the libarary and then a regular:

python install

eventually with sudo to install it.

Comment #6
Dec. 11, 2010, 4:50 p.m.

Thanks for the answer! Do you know if it is possible to pass this option to when using easy_install?

Comment #7
Daniele Varrazzo
Dec. 11, 2010, 5:19 p.m.

This is a distutils-specific question: after some quick googling it seems there is no solution (see for example this thread). I don't know about other distutils-like packages (distribute, PIP...)

By default psycopg setup looks for pg_config in the path anyway, so an easier solution may be prepending its directory to the PATH when running easy_install; you may try something like:

PATH=/path/to/postgres/bins:$PATH easy_install psycopg2

Comment #8
Dec. 14, 2010, 10:04 p.m.

Is this psycopg 2.3.x 100% backward-compatible with the 2.0.x series?

Comment #9
Daniele Varrazzo
Dec. 14, 2010, 10:58 p.m.

It should be, we do our best to maintain backward compatibility.

In 2.2 we have changed the interface for the async features (i.e. cursor.execute(async=1) is gone), but the async area was mostly an experiment before. The stable features shouldn't have been changed in a non-compatible way.

Feel free to add a new comment. You can use reST syntax.