Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYjvd-0006fC-VF for pgsql-general@arkaria.postgresql.org; Wed, 13 May 2020 05:27:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jYjvc-0006he-T9 for pgsql-general@arkaria.postgresql.org; Wed, 13 May 2020 05:27:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYjvc-0006hW-LJ for pgsql-general@lists.postgresql.org; Wed, 13 May 2020 05:27:36 +0000 Received: from smh-06.1blu.de ([178.254.0.206]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jYjva-0007uh-0k for pgsql-general@lists.postgresql.org; Wed, 13 May 2020 05:27:36 +0000 Received: from [172.16.29.5] (helo=sh4-5.1blu.de) by smh-06.1blu.de with esmtp (Exim 4.86_2) (envelope-from ) id 1jYjvX-0006aS-6J for pgsql-general@lists.postgresql.org; Wed, 13 May 2020 07:27:31 +0200 Received: from ftp51246-2575596 by sh4-5.1blu.de with local (Exim 4.90_1) (envelope-from ) id 1jYjvX-0007ZF-4A for pgsql-general@lists.postgresql.org; Wed, 13 May 2020 07:27:31 +0200 Date: Wed, 13 May 2020 07:27:31 +0200 From: Matthias Apitz To: pgsql-general@lists.postgresql.org Subject: Re: ESQL/C: a ROLLBACK rolls back a COMMITED transaction Message-ID: <20200513052731.GA26063@sh4-5.1blu.de> Reply-To: Matthias Apitz 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> <20200512235207.GA3420@sh4-5.1blu.de> <2136.1589328075@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2136.1589328075@sss.pgh.pa.us> X-Operating-System: FreeBSD 12.0-CURRENT r314251 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk El día Dienstag, Mai 12, 2020 a las 08:01:15 -0400, Tom Lane escribió: > Matthias Apitz writes: > > And in the log the line logged is: > > [1471] [12.05.2020 15:48:50:476]: ecpg_process_output on line 1744: OK: INSERT 0 1 > > What I wanted to have is: > > [1471] [12.05.2020 15:48:50:476]: ecpg_process_output on line 1744 of swd_daten.pgc: OK: INSERT 0 1 > > i.e. have added the file name to the line number as "on line 1744 of > > swd_daten.pgc" to not always have to think, hey in which table we're > > with this at the moment. > > Not an unreasonable suggestion, but it'd be more likely to happen if > you send in a patch ;-). I was already thinking somemonths ago in a change (and patch proposal). The problem is, that the generated C-code for an ESQL/C statement looks today like this: { ECPGdo(__LINE__, 0, 0, NULL, 0, ECPGst_normal, "insert into swd_daten ( katkey , aktion , reserv , id , ansetzung , nettodaten ) values ( $1 , $2 , $3 , $4 , $5 , $6 )", ECPGt_long,&(new_value),(long)1,(long)1,sizeof(long), ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_short,&(hrec_swd_daten.aktion),(long)1,(long)1,sizeof(short), ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_char,(hrec_swd_daten.reserv),(long)2,(long)1,(2)*sizeof(char), ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ... ECPGt_char,(hrec_swd_daten.nettodaten),(long)SWD_DATEN_BUF_MAX,(long)1,(SWD_DATEN_BUF_MAX)*sizeof(char), ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); #line 1745 "swd_daten.pgc" if (sqlca.sqlcode == ECPG_NOT_FOUND) posSqlNotFound ( ); #line 1745 "swd_daten.pgc" if (sqlca.sqlwarn[0] == 'W') posSqlWarning ( ); #line 1745 "swd_daten.pgc" if (sqlca.sqlcode < 0) posSqlError ( );} and should be expanded to: { ECPGdo(__LINE__, __FILE__, 0, 0, NULL, 0, ECPGst_normal, "insert ... as the first argument to ECPGdo() is of type int we can not do a hack like "__LINE__:"__FILE__ (i.e. concatenating line number and filename into one string. We have to change the call interface function ECPGdo() and add a string argument. This would make fail all older compiled applications when the new shared lib having this call is installed. Here I'm stuck with the idea. matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub