It should be possible to support both simultaneously: https://www.psycopg.org/psycopg3/docs/basic/from_pg2.html#from-psycopg2