The version number is written in the psycopg2ct/__init__.py module. It is read from there by setup.py, which appends a list of flags to it and writes it into the _config module, from which the version string is imported back into the package. Currently the only flag used is "ctypes" so that the implementation can be identified from the cpython one (which sports a version string such as '2.4.4 (dt dec mx pq3 ext)').
…e psycopg2 module.
…q.PQgetisnull if the value is an empty string