We have to close the cursor or rollback the transaction in case offailure?

Поиск
Список
Период
Сортировка
От M Tarkeshwar Rao
Тема We have to close the cursor or rollback the transaction in case offailure?
Дата
Msg-id VI1PR0701MB27183BDF1E22EA50E87206B3AE5C0@VI1PR0701MB2718.eurprd07.prod.outlook.com
обсуждение исходный текст
Ответы Re: We have to close the cursor or rollback the transaction in case of failure?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general

Hi all,

 

I am using cursors to fetch the data from table using  C++. Initially were errors as highlighted  as “current transaction isaborted” in /var/logs during full vacuum.

 

We are little bit confused in failure handling. In case of any failure of following function.

PQexec(connection, myFetchSql)

 

We have to close the cursor or rollback the transaction?

 

postgres[10709]: [6-1] < 2019-10-29 11:24:22.550 CET > ERROR:  canceling statement due to conflict with recovery

postgres[10709]: [6-2] < 2019-10-29 11:24:22.550 CET > DETAIL:  User query might have needed to see row versions that must be removed.

postgres[10709]: [6-3] < 2019-10-29 11:24:22.550 CET > STATEMENT:  FETCH 1000 IN mycursor_3461662464_1572368715367985819

postgres[10709]: [7-1] < 2019-10-29 11:24:22.550 CET > ERROR:  current transaction is aborted, commands ignored until end of transaction block

postgres[10709]: [7-2] < 2019-10-29 11:24:22.550 CET > STATEMENT:  CLOSE mycursor_3461662464_1572368715367985819

O

 

 

Regards

Tarkeshwar

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

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: Logging
Следующее
От: Sonam Sharma
Дата:
Сообщение: Schema Copy