Add conditional imports for psycopg2.