Getting following error in using cursor to fetch the records from alarge table in c language(current transaction is aborted, commands ignoreduntil end of transaction block)

Поиск
Список
Период
Сортировка
От M Tarkeshwar Rao
Тема Getting following error in using cursor to fetch the records from alarge table in c language(current transaction is aborted, commands ignoreduntil end of transaction block)
Дата
Msg-id VI1PR0701MB27188D31EF30EE58BE3BEC4AAE620@VI1PR0701MB2718.eurprd07.prod.outlook.com
обсуждение исходный текст
Ответы Re: Getting following error in using cursor to fetch the records froma large table in c language(current transaction is aborted, commands ignoreduntil end of transaction block)
Список pgsql-general

Hi all,

 

Getting following error in using cursor to fetch the records from a large table in c language.

Can you please suggest why it is coming and what is the remedy for this.

 

Error Details

-----------------

Nov  1 13:21:54 sprintstd2 postgres[18604]: [10-1] < 2019-11-01 13:21:54.212 CET > ERROR:  current transaction is aborted, commands ignored until end of transaction block
Nov  1 13:21:54 sprintstd2 postgres[18604]: [10-2] < 2019-11-01 13:21:54.212 CET > STATEMENT:  BEGIN
Nov  1 13:21:54 sprintstd2 postgres[18604]: [11-1] < 2019-11-01 13:21:54.324 CET > ERROR:  current transaction is aborted, commands ignored until end of transaction block
Nov  1 13:21:54 sprintstd2 postgres[18604]: [11-2] < 2019-11-01 13:21:54.324 CET > STATEMENT:  BEGIN
Nov  1 13:21:54 sprintstd2 postgres[18604]: [12-1] < 2019-11-01 13:21:54.356 CET > ERROR:  current transaction is aborted, commands ignored until end of transaction block
Nov  1 13:21:54 sprintstd2 postgres[18604]: [12-2] < 2019-11-01 13:21:54.356 CET > STATEMENT:  BEGIN
Nov  1 13:21:54 sprintstd2 postgres[18604]: [13-1] < 2019-11-01 13:21:54.360 CET > ERROR:  current transaction is aborted, commands ignored until end of transaction block
Nov  1 13:21:54 sprintstd2 postgres[18604]: [13-2] < 2019-11-01 13:21:54.360 CET > STATEMENT

 

Sample Code snippet used

 

        theCursorDec = (RWCString)"DECLARE " +  mySqlCursor + " CURSOR FOR " + theSql;

        myFetchSql = "FETCH " + fetchStr + " IN " + mySqlCursor;

 

        // Begin the cursor

        PQexec(connection, ,"BEGIN"))

        PQexec(connection, ,"myFetchSql”)

 

        // Fetch records from the cursor. Getting First N tuples

        mySqlResultsPG = PQexec(connection,myFetchSql);

        if(PQresultStatus(mySqlResultsPG) == PGRES_TUPLES_OK)

        {

                myNumColumns = PQnfields(mySqlResultsPG);

                ntuples = PQntuples(mySqlResultsPG);

                myTotalNumberOfRowsInQueryResult = ntuples;

                myCurrentRowNum = 0 ;

        }

 

Regards

Tarkeshwar

 

В списке pgsql-general по дате отправления:

Предыдущее
От: Daulat Ram
Дата:
Сообщение: RE: Barman
Следующее
От: Shatamjeev Dewan
Дата:
Сообщение: RE: Declarative Range Partitioning Postgres 11