Re: DROP TABLE and concurrent modifications - Mailing list pgsql-hackers

From Neil Conway
Subject Re: DROP TABLE and concurrent modifications
Date
Msg-id 87wu6mglkd.fsf@mailbox.samurai.com
Whole thread Raw
In response to DROP TABLE and concurrent modifications  (Neil Conway <neilc@samurai.com>)
List pgsql-hackers
Neil Conway <neilc@samurai.com> writes:
>      1. Have a process do INSERTs into a table in a tight loop (I've
>         attached a trivial libpq app that does this)

Sorry, I was evidently a little too quick off the draw. A simple test
app is /really/ attached this time.

-Neil

#include <stdio.h>
#include <unistd.h>
#include <libpq-fe.h>

int
main(void)
{
    PGconn *conn;

    conn = PQconnectdb("");
    if (PQstatus(conn) == CONNECTION_BAD)
        return 1;

    for (;;)
    {
        PGresult *res;

        res = PQexec(conn, "INSERT INTO test_tbl VALUES (5, 5, 5);");
        if (PQresultStatus(res) != PGRES_COMMAND_OK)
        {
            /* query failed */
            printf("query failed: %s", PQresultErrorMessage(res));
            fflush(stdout);
            sleep(1);
        }

        PQclear(res);
    }

    PQfinish(conn);

    return 0;
}

pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: DROP TABLE and concurrent modifications
Next
From: Tom Lane
Date:
Subject: Re: DROP TABLE and concurrent modifications