code: def close(self):
          
          if not self._conn:
              raise psycopg2.InterfaceError('Connection not open')
          LOGGER.info('Closing connection %r in %s', self._conn, self.pid)
          self._pool_manager.free(self.pid, self._conn)
          self._pool_manager.remove_connection(self.pid, self._conn)
  
          # Un-assign the connection and cursor
          self._conn, self._cursor = None, None
docs: Explicitly close the connection and remove it from the connection
          pool if pooling is enabled. If the connection is already closed
  
          :raises: psycopg2.InterfaceError