def METHOD_NAME(request, python_version):
    postgres_cursor = request.getfixturevalue("postgres_cursor")
    runner = PostgresAgentRunner()
    runner.start(executable=python_version)
    time.sleep(1)
    agent_log_reader = AgentLogReader(runner.agent_log_file_path)
    agent_log_reader.start()
    # wait for agent logs about postgres monitor is started.
    agent_log_reader.wait_for_matching_line(
        pattern=r"\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+Z INFO \[core\] \[scalyr_agent.monitors_manager:\d+\] Starting monitor postgres_monitor\(mydb\)"
    )
    # just wait more to be sure that there are no errors in the agent.log.
    agent_log_reader.wait(3)
    postgres_cursor.execute(
        "CREATE TABLE test_table( id SERIAL PRIMARY KEY, text VARCHAR(255));"
    )
    reader = PostgresLogReader(runner.mysql_log_path)
    reader.start()
    metrics_to_check = ["postgres.database.size"]
    reader.wait_for_metrics_exist(metrics_to_check)
    postgres_cursor.execute("SELECT * FROM test_table")
    rows = postgres_cursor.fetchall()
    assert len(rows) == 0
    postgres_cursor.execute(
        "INSERT INTO test_table (text) values ('row1') RETURNING id"
    )
    (row1_id,) = postgres_cursor.fetchone()
    postgres_cursor.execute("SELECT * FROM test_table")
    rows = postgres_cursor.fetchall()
    assert len(rows) == 1
    postgres_cursor.execute(
        "INSERT INTO test_table (text) values ('row2') RETURNING id"
    )
    (row2_id,) = postgres_cursor.fetchone()
    postgres_cursor.execute("SELECT * FROM test_table")
    rows = postgres_cursor.fetchall()
    assert len(rows) == 2
    postgres_cursor.execute("DELETE FROM test_table WHERE id={0};".format(row2_id))
    postgres_cursor.execute("SELECT * FROM test_table;")
    rows = postgres_cursor.fetchall()
    assert len(rows) == 1
    postgres_cursor.execute(
        "UPDATE test_table SET text='updated_row1' WHERE id={0};".format(row1_id)
    )
    postgres_cursor.execute("SELECT text FROM test_table WHERE id={0}".format(row1_id))
    (row1_text,) = postgres_cursor.fetchone()
    assert row1_text == "updated_row1"
    agent_log_reader.go_to_end()