1. CONNECT TO POSTGRESQL With python script 2. psycopg is a PostgreSQL database adapter for the Python_ programming language. This is version 2, a complete rewrite of…