Re: DROP TABLE and concurrent modifications
| От | Neil Conway |
|---|---|
| Тема | Re: DROP TABLE and concurrent modifications |
| Дата | |
| Msg-id | 87wu6mglkd.fsf@mailbox.samurai.com обсуждение исходный текст |
| Ответ на | DROP TABLE and concurrent modifications (Neil Conway <neilc@samurai.com>) |
| Список | 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 по дате отправления: