From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Matthias Apitz <guru@unixarea.de>
To: pgsql-general@lists.postgresql.org
Subject: Re: ESQL/C: a ROLLBACK rolls back a COMMITED transaction
Date: Tue, 12 May 2020 12:30:17 -0700
Message-ID: <9dbc6477-f9a2-b62a-e011-0983fe150741@aklaver.com> (raw)
In-Reply-To: <20200512191429.GB32335@sh4-5.1blu.de>
References: <20200512145352.GA32335@sh4-5.1blu.de>
<23100.1589298880@sss.pgh.pa.us>
<20200512191429.GB32335@sh4-5.1blu.de>
On 5/12/20 12:14 PM, Matthias Apitz wrote:
>
> To answer also the question of Adrian Klaver:
>
> The database in question has ~400 tables and the ESQL/C application has
> for each table its own ESQL/C source file. It would be possible but a
> nightmare to share the code and it's better to discuss the problem based
> on the ESQL/c log file or I have to write some small example code to
> reproduce the problem. The line numbers are relative to those source
> files (and it's a pitty that the name of the source file is not logged,
> onle the line numbers).
Yeah, but there is a one:one mapping of table:source file and you know
the table, so you should be able to find the source at the line number.
Or am I missing something?
Also, from OP did:
insert into swd_auftrag ..
COMMIT?
>
> El día Dienstag, Mai 12, 2020 a las 11:54:40 -0400, Tom Lane escribió:
>
>> Matthias Apitz <guru@unixarea.de> writes:
>>> We're facing in our ESQL/C written application a situation where a
>>> commit'ed INSERT into a table is rolled back.
>>
>> Kind of hard to believe ... is there any sign of distress in the
>> postmaster log?
>
> No. Nothing which points to this.
>
>>
>>> I have here the ESQL/C
>>> logging of the problem:
>>
>>> ...
>>> [1471] [12.05.2020 15:48:50:476]: ecpg_execute on line 1744: query: insert into swd_daten ( katkey , aktion , reserv , id , ansetzung , nettodaten ) values ( $1 , $2 , $3 , $4 , $5 , $6 ); with 6 parameter(s) on connection sisis
>>> [1471] [12.05.2020 15:48:50:476]: ecpg_process_output on line 1744: OK: INSERT 0 1
>>> [1471] [12.05.2020 15:48:50:477]: ECPGtrans on line 6716: action "commit"; connection "sisis"
>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>
>> It's striking that this log shows a server ack of the INSERT, but no server
>> ack of the COMMIT. Maybe that's just an oversight in the ESQL/C logging
>> logic, but I wonder what's actually getting to the server. You might try
>
> I looked into the source and the ECPGtrans ... is logged before its
> execution in the source interfaces/ecpg/ecpglib/misc.c and after the
> execution only an error condition would be logged. As there is only the
> line of the COMMIT w/o anything else, it seems to be executed fine.
>
>> enabling log_statement = all so you can get a trace of what the server
>> thinks is happening.
>
> I will do so, but would have to find a time window for this to not be
> swamped by the logs.
>
> Thanks for your reply to both, Adiran and Tom.
>
> matthias
>
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, guru@unixarea.de
Subject: Re: ESQL/C: a ROLLBACK rolls back a COMMITED transaction
In-Reply-To: <9dbc6477-f9a2-b62a-e011-0983fe150741@aklaver.com>
References: <20200512145352.GA32335@sh4-5.1blu.de> <23100.1589298880@sss.pgh.pa.us> <20200512191429.GB32335@sh4-5.1blu.de> <9dbc6477-f9a2-b62a-e011-0983fe150741@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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