[ADMIN] Dealing with a cursor in libpq c program
От | John Scalia |
---|---|
Тема | [ADMIN] Dealing with a cursor in libpq c program |
Дата | |
Msg-id | CABzCKRDPfhQa9bDFrU6a4vQqK5qfq2mVzNNUdtzwaCxaS_uM6g@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: [ADMIN] Dealing with a cursor in libpq c program
|
Список | pgsql-admin |
Hi all,
This posting is really two parts and here's part 1. As a test, I've been building text indexes on some datasets from our data warehouse. I've built both trigram and gin indexes. My two largest sets threw warnings while the gin index was being built of "Cannot index word. Words greater than 2047 characters cannot be indexed." Overall, this is not a very helpful message as the two sets contain more than 25 million rows each. It would have really nice to get a row number or a sample of the errant word with the warning message.res = PQexec(conn, "FETCH FORWARD 500 FROM note_text_cursor");
printf("res = %d\n", PQresultStatus(res));
while (PQresultStatus(res) == PGRES_TUPLES_OK)
{
printf("Got a PGRES_TUPLES_OK from the FETCH FORWARD command, parsing each row\n");
for (int i = 0; i < PQntuples(res); ++i)
{
char line[4000];
strcpy(line, PQgetvalue(res, i, 0));
printf("retrieved line: %s\n", line);
strcpy(line, "");
}
}
--
В списке pgsql-admin по дате отправления: