Compatibility with older psycopg2==2.4.1.