This fix appears to work for me (MAMP 6 and Big Sur): https://naguel.com/unable-to-load-dynamic-library-pgsql-so/