pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedGetting following error in using cursor to fetch the records from a large table in c language
11+ messages / 3 participants
[nested] [flat]
* Getting following error in using cursor to fetch the records from a large table in c language
@ 2019-10-30 16:59 M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-10-30 17:50 ` Re: Getting following error in using cursor to fetch the records from a large table in c language Laurenz Albe <laurenz.albe@cybertec.at>
0 siblings, 1 reply; 11+ messages in thread
From: M Tarkeshwar Rao @ 2019-10-30 16:59 UTC (permalink / raw)
To: 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
-----------------
Failed to execute the sql command close:
mycursor_4047439616_1571970686004430275FATAL: terminating connection due to conflict with recovery
DETAIL: User query might have needed to see row versions that must be removed.
HINT: In a moment you should be able to reconnect to the database and repeat your command.
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
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Getting following error in using cursor to fetch the records from a large table in c language
2019-10-30 16:59 Getting following error in using cursor to fetch the records from a large table in c language M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
@ 2019-10-30 17:50 ` Laurenz Albe <laurenz.albe@cybertec.at>
2019-10-31 05:18 ` RE: Getting following error in using cursor to fetch the records from a large table in c language M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
0 siblings, 1 reply; 11+ messages in thread
From: Laurenz Albe @ 2019-10-30 17:50 UTC (permalink / raw)
To: M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>; pgsql-general
On Wed, 2019-10-30 at 16:59 +0000, M Tarkeshwar Rao wrote:
> 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
> -----------------
> Failed to execute the sql command close:
> mycursor_4047439616_1571970686004430275FATAL: terminating connection due to conflict with recovery
> DETAIL: User query might have needed to see row versions that must be removed.
> HINT: In a moment you should be able to reconnect to the database and repeat your command.
This is not a proble with your program.
Your query is running against a standby server with "hot_standby" on,
and there are conflicts between replication and your query.
If you increase "max_standby_streaming_delay" in "postgresql.conf" on
the standby, your query will be given more time to complete.
This will, however, cause replay of the replicated changes to be delayed.
Yours,
Laurenz Albe
^ permalink raw reply [nested|flat] 11+ messages in thread
* RE: Getting following error in using cursor to fetch the records from a large table in c language
2019-10-30 16:59 Getting following error in using cursor to fetch the records from a large table in c language M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-10-30 17:50 ` Re: Getting following error in using cursor to fetch the records from a large table in c language Laurenz Albe <laurenz.albe@cybertec.at>
@ 2019-10-31 05:18 ` M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-10-31 06:57 ` Re: Getting following error in using cursor to fetch the records from a large table in c language Laurenz Albe <laurenz.albe@cybertec.at>
0 siblings, 1 reply; 11+ messages in thread
From: M Tarkeshwar Rao @ 2019-10-31 05:18 UTC (permalink / raw)
To: Laurenz Albe <laurenz.albe@cybertec.at>; pgsql-general
Hi Laurenz,
You are absolutely right. This is the issue with us.
If we retry the query again. Will it be successful?
Can you please suggest how to configure hot_standby_feedback?
Regards
Tarkeshwar
-----Original Message-----
From: Laurenz Albe <laurenz.albe@cybertec.at>
Sent: Wednesday, October 30, 2019 11:20 PM
To: M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>; 'pgsql-general@postgresql.org' <pgsql-general@postgresql.org>
Subject: Re: Getting following error in using cursor to fetch the records from a large table in c language
On Wed, 2019-10-30 at 16:59 +0000, M Tarkeshwar Rao wrote:
> 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
> -----------------
> Failed to execute the sql command close:
> mycursor_4047439616_1571970686004430275FATAL: terminating connection
> due to conflict with recovery
> DETAIL: User query might have needed to see row versions that must be removed.
> HINT: In a moment you should be able to reconnect to the database and repeat your command.
This is not a proble with your program.
Your query is running against a standby server with "hot_standby" on, and there are conflicts between replication and your query.
If you increase "max_standby_streaming_delay" in "postgresql.conf" on the standby, your query will be given more time to complete.
This will, however, cause replay of the replicated changes to be delayed.
Yours,
Laurenz Albe
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Getting following error in using cursor to fetch the records from a large table in c language
2019-10-30 16:59 Getting following error in using cursor to fetch the records from a large table in c language M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-10-30 17:50 ` Re: Getting following error in using cursor to fetch the records from a large table in c language Laurenz Albe <laurenz.albe@cybertec.at>
2019-10-31 05:18 ` RE: Getting following error in using cursor to fetch the records from a large table in c language M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
@ 2019-10-31 06:57 ` Laurenz Albe <laurenz.albe@cybertec.at>
2019-10-31 07:15 ` RE: Getting following error in using cursor to fetch the records from a large table in c language M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
0 siblings, 1 reply; 11+ messages in thread
From: Laurenz Albe @ 2019-10-31 06:57 UTC (permalink / raw)
To: M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>; pgsql-general
On Thu, 2019-10-31 at 05:18 +0000, M Tarkeshwar Rao wrote:
[queries get canceled on the standby]
> You are absolutely right. This is the issue with us.
> If we retry the query again. Will it be successful?
Sometimes :^/
> Can you please suggest how to configure hot_standby_feedback?
You set it to "on", then you get no query cancellation because of
VACUUM (at the price of potential bloat on the primary server).
Your query can still get canceled by conflichts with ACCESS EXCLUSIVE
locks that are taken by TRUNCATE, ALTER/DROP TABLE and similar
as well as autovacuum truncation.
Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com
^ permalink raw reply [nested|flat] 11+ messages in thread
* RE: Getting following error in using cursor to fetch the records from a large table in c language
2019-10-30 16:59 Getting following error in using cursor to fetch the records from a large table in c language M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-10-30 17:50 ` Re: Getting following error in using cursor to fetch the records from a large table in c language Laurenz Albe <laurenz.albe@cybertec.at>
2019-10-31 05:18 ` RE: Getting following error in using cursor to fetch the records from a large table in c language M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-10-31 06:57 ` Re: Getting following error in using cursor to fetch the records from a large table in c language Laurenz Albe <laurenz.albe@cybertec.at>
@ 2019-10-31 07:15 ` M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-10-31 19:07 ` Re: Getting following error in using cursor to fetch the records from a large table in c language Laurenz Albe <laurenz.albe@cybertec.at>
2019-11-01 06:25 ` RE: Getting following error in using cursor to fetch the records from a large table in c language M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
0 siblings, 2 replies; 11+ messages in thread
From: M Tarkeshwar Rao @ 2019-10-31 07:15 UTC (permalink / raw)
To: Laurenz Albe <laurenz.albe@cybertec.at>; pgsql-general
When we running with vacuum full we are getting following error message.
Error:
-------
user was holding a relation lock for too long
Any idea about this error.
-----Original Message-----
From: Laurenz Albe <laurenz.albe@cybertec.at>
Sent: Thursday, October 31, 2019 12:28 PM
To: M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>; 'pgsql-general@postgresql.org' <pgsql-general@postgresql.org>
Subject: Re: Getting following error in using cursor to fetch the records from a large table in c language
On Thu, 2019-10-31 at 05:18 +0000, M Tarkeshwar Rao wrote:
[queries get canceled on the standby]
> You are absolutely right. This is the issue with us.
> If we retry the query again. Will it be successful?
Sometimes :^/
> Can you please suggest how to configure hot_standby_feedback?
You set it to "on", then you get no query cancellation because of VACUUM (at the price of potential bloat on the primary server).
Your query can still get canceled by conflichts with ACCESS EXCLUSIVE locks that are taken by TRUNCATE, ALTER/DROP TABLE and similar as well as autovacuum truncation.
Yours,
Laurenz Albe
--
Cybertec | https://protect2.fireeye.com/v1/url?k=a20e6965-fe84a291-a20e29fe-86cd58c48020-fb007d5e5585f41b&q...
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Getting following error in using cursor to fetch the records from a large table in c language
2019-10-30 16:59 Getting following error in using cursor to fetch the records from a large table in c language M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-10-30 17:50 ` Re: Getting following error in using cursor to fetch the records from a large table in c language Laurenz Albe <laurenz.albe@cybertec.at>
2019-10-31 05:18 ` RE: Getting following error in using cursor to fetch the records from a large table in c language M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-10-31 06:57 ` Re: Getting following error in using cursor to fetch the records from a large table in c language Laurenz Albe <laurenz.albe@cybertec.at>
2019-10-31 07:15 ` RE: Getting following error in using cursor to fetch the records from a large table in c language M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
@ 2019-10-31 19:07 ` Laurenz Albe <laurenz.albe@cybertec.at>
1 sibling, 0 replies; 11+ messages in thread
From: Laurenz Albe @ 2019-10-31 19:07 UTC (permalink / raw)
To: M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>; pgsql-general
M Tarkeshwar Rao wrote:
> When we running with vacuum full we are getting following error message.
>
> Error:
> -------
> user was holding a relation lock for too long
>
> Any idea about this error.
That means that you got a replication conflict, which is to be expected,
because VACUUM (FULL) is also one of the commands that require an
ACCESS EXCLUSIVE lock.
First suggestion: don't use VACUUM (FULL).
Second suggestion: A standby server can *either* be used for high
availability, in which case queries on the standby should be forbidden
or canceled in case of conflicts, *or* it can be used to run resource
intensive reading queries, in which case application of the transaction
log should be delayed.
Don't try to use a standby for both - use two standby servers.
Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com
^ permalink raw reply [nested|flat] 11+ messages in thread
* RE: Getting following error in using cursor to fetch the records from a large table in c language
2019-10-30 16:59 Getting following error in using cursor to fetch the records from a large table in c language M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-10-30 17:50 ` Re: Getting following error in using cursor to fetch the records from a large table in c language Laurenz Albe <laurenz.albe@cybertec.at>
2019-10-31 05:18 ` RE: Getting following error in using cursor to fetch the records from a large table in c language M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-10-31 06:57 ` Re: Getting following error in using cursor to fetch the records from a large table in c language Laurenz Albe <laurenz.albe@cybertec.at>
2019-10-31 07:15 ` RE: Getting following error in using cursor to fetch the records from a large table in c language M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
@ 2019-11-01 06:25 ` M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
1 sibling, 0 replies; 11+ messages in thread
From: M Tarkeshwar Rao @ 2019-11-01 06:25 UTC (permalink / raw)
To: Laurenz Albe <laurenz.albe@cybertec.at>; pgsql-general
Hi,
If VACUUM full is going on and any conflicting query come then what will happen to that query.
Regards
Tarkeshwar
-----Original Message-----
From: M Tarkeshwar Rao
Sent: Thursday, October 31, 2019 12:45 PM
To: Laurenz Albe <laurenz.albe@cybertec.at>; 'pgsql-general@postgresql.org' <pgsql-general@postgresql.org>
Subject: RE: Getting following error in using cursor to fetch the records from a large table in c language
When we running with vacuum full we are getting following error message.
Error:
-------
user was holding a relation lock for too long
Any idea about this error.
-----Original Message-----
From: Laurenz Albe <laurenz.albe@cybertec.at>
Sent: Thursday, October 31, 2019 12:28 PM
To: M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>; 'pgsql-general@postgresql.org' <pgsql-general@postgresql.org>
Subject: Re: Getting following error in using cursor to fetch the records from a large table in c language
On Thu, 2019-10-31 at 05:18 +0000, M Tarkeshwar Rao wrote:
[queries get canceled on the standby]
> You are absolutely right. This is the issue with us.
> If we retry the query again. Will it be successful?
Sometimes :^/
> Can you please suggest how to configure hot_standby_feedback?
You set it to "on", then you get no query cancellation because of VACUUM (at the price of potential bloat on the primary server).
Your query can still get canceled by conflichts with ACCESS EXCLUSIVE locks that are taken by TRUNCATE, ALTER/DROP TABLE and similar as well as autovacuum truncation.
Yours,
Laurenz Albe
--
Cybertec | https://protect2.fireeye.com/v1/url?k=a20e6965-fe84a291-a20e29fe-86cd58c48020-fb007d5e5585f41b&q...
^ permalink raw reply [nested|flat] 11+ messages in thread
* Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block)
@ 2019-11-01 12:44 M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-11-01 17:08 ` Re: Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block) Francisco Olarte <folarte@peoplecall.com>
0 siblings, 1 reply; 11+ messages in thread
From: M Tarkeshwar Rao @ 2019-11-01 12:44 UTC (permalink / raw)
To: 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
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block)
2019-11-01 12:44 Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block) M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
@ 2019-11-01 17:08 ` Francisco Olarte <folarte@peoplecall.com>
2019-11-02 16:16 ` RE: Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block) M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
0 siblings, 1 reply; 11+ messages in thread
From: Francisco Olarte @ 2019-11-01 17:08 UTC (permalink / raw)
To: M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>; +Cc: pgsql-general
On Fri, Nov 1, 2019 at 1:44 PM M Tarkeshwar Rao
<m.tarkeshwar.rao@ericsson.com> wrote:
> Getting following error in using cursor to fetch the records from a large table in c language.
Regarding this, "c language", I'll comment later....
> Can you please suggest why it is coming and what is the remedy for this.
> 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
This seems incomplete, but I's telling you the cause. You had an
error, you need to terminate the transaction before issuing a new one,
i.e., do a commit ( which, IIRC, will rollback if the transaction is
in error ) or rollback.
> Sample Code snippet used
As you stated C I cannot comment too much, but notice:
> theCursorDec = (RWCString)"DECLARE " + mySqlCursor + " CURSOR FOR " + theSql;
> myFetchSql = "FETCH " + fetchStr + " IN " + mySqlCursor;
Neither of these are C, they COULD be C++
> // Begin the cursor
Same as this comment.
> PQexec(connection, ,"BEGIN"))
> PQexec(connection, ,"myFetchSql”)
And these are definitely not C ( no ; ) and, if you generated them by
editing, myfetchsql is quoted which smells fishy.
I won't comment more until you confirm that is the real code, but
anyway it seems to me you issue transaction start queries without
properly terminating them with a transaction end one.
Francisco Olarte
^ permalink raw reply [nested|flat] 11+ messages in thread
* RE: Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block)
2019-11-01 12:44 Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block) M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-11-01 17:08 ` Re: Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block) Francisco Olarte <folarte@peoplecall.com>
@ 2019-11-02 16:16 ` M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-11-03 08:49 ` Re: Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block) Francisco Olarte <folarte@peoplecall.com>
0 siblings, 1 reply; 11+ messages in thread
From: M Tarkeshwar Rao @ 2019-11-02 16:16 UTC (permalink / raw)
To: Francisco Olarte <folarte@peoplecall.com>; +Cc: pgsql-general
Thanks Yes it is in c++. Actually we just written this code.
Due to vaccum full cursor query failing on a connection and all the subsequent queries are failing and we
found shared errors in /var/logs of the postgres installed machine.
We also last query sent by the client application is:
replicateDB=# select pid, state, backend_start, query_start, query from pg_stat_activity;
pid | state | backend_start | query_start | query
-------+-------------------------------+-------------------------------+-------------------------------+-----------------------------------------------------
------------------------
18604 | idle in transaction (aborted) | 2019-11-01 13:18:07.919162+01 | 2019-11-01 13:23:19.92045+01 | BEGIN
-----Original Message-----
From: Francisco Olarte <folarte@peoplecall.com>
Sent: Friday, November 1, 2019 10:38 PM
To: M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block)
On Fri, Nov 1, 2019 at 1:44 PM M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com> wrote:
> Getting following error in using cursor to fetch the records from a large table in c language.
Regarding this, "c language", I'll comment later....
> Can you please suggest why it is coming and what is the remedy for this.
> 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
This seems incomplete, but I's telling you the cause. You had an error, you need to terminate the transaction before issuing a new one, i.e., do a commit ( which, IIRC, will rollback if the transaction is in error ) or rollback.
> Sample Code snippet used
As you stated C I cannot comment too much, but notice:
> theCursorDec = (RWCString)"DECLARE " + mySqlCursor + " CURSOR FOR " + theSql;
> myFetchSql = "FETCH " + fetchStr + " IN " + mySqlCursor;
Neither of these are C, they COULD be C++
> // Begin the cursor
Same as this comment.
> PQexec(connection, ,"BEGIN"))
> PQexec(connection, ,"myFetchSql”)
And these are definitely not C ( no ; ) and, if you generated them by editing, myfetchsql is quoted which smells fishy.
I won't comment more until you confirm that is the real code, but anyway it seems to me you issue transaction start queries without properly terminating them with a transaction end one.
Francisco Olarte
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block)
2019-11-01 12:44 Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block) M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-11-01 17:08 ` Re: Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block) Francisco Olarte <folarte@peoplecall.com>
2019-11-02 16:16 ` RE: Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block) M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
@ 2019-11-03 08:49 ` Francisco Olarte <folarte@peoplecall.com>
0 siblings, 0 replies; 11+ messages in thread
From: Francisco Olarte @ 2019-11-03 08:49 UTC (permalink / raw)
To: M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>; +Cc: pgsql-general
M Tarkeshwar Rao:
On Sat, Nov 2, 2019 at 5:16 PM M Tarkeshwar Rao
<m.tarkeshwar.rao@ericsson.com> wrote:
> Thanks Yes it is in c++. Actually we just written this code.
> Due to vaccum full cursor query failing on a connection and all the subsequent queries are failing and we
> found shared errors in /var/logs of the postgres installed machine.
... Some more things followed by a huge bottom quote-to-the-sig.....
Your writing style makes it really hard to decipher what you are
trying to say. I hope your problem has been solved, because I am not
going to try to decipher it or comment more.
Francisco Olarte.
^ permalink raw reply [nested|flat] 11+ messages in thread
end of thread, other threads:[~2019-11-03 08:49 UTC | newest]
Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-10-30 16:59 Getting following error in using cursor to fetch the records from a large table in c language M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-10-30 17:50 ` Laurenz Albe <laurenz.albe@cybertec.at>
2019-10-31 05:18 ` M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-10-31 06:57 ` Laurenz Albe <laurenz.albe@cybertec.at>
2019-10-31 07:15 ` M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-10-31 19:07 ` Laurenz Albe <laurenz.albe@cybertec.at>
2019-11-01 06:25 ` M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-11-01 12:44 Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block) M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-11-01 17:08 ` Re: Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block) Francisco Olarte <folarte@peoplecall.com>
2019-11-02 16:16 ` RE: Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block) M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
2019-11-03 08:49 ` Re: Getting following error in using cursor to fetch the records from a large table in c language(current transaction is aborted, commands ignored until end of transaction block) Francisco Olarte <folarte@peoplecall.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox