Connecting to a DatabaseUse the psycopg2.connect function to obtain the connection object.Use the connection object to create a cursor object.