Support psycopg as a PostgreSQL driver
This adds support for psycopg (aka psycopg3) as a PostgreSQL driver in addition to psycopg2. This requires adding some abstractions between psycopg2 and psycopg although most of the queries can be identical (since it is just PostgreSQL underneath).
This is a branch that @realtyem and myself have been working on for several years.
The bulk of this PR is splitting the PostgresEngine into a PsycopgEngine and Psycopg2Engine which use the correct underlying driver. We then need to update some if-statements in the code to differentiate between these.
A bunch of configuration code also needs to be adjusted to handle having multiple engines for postgres.
This also updates the test matrix for trial to run against psycopg2 and psycopg.
This is step 1 of #14586.
I think this is ready for a review, I'm sure it'll need a few changes, but overall I think it is sound.