Re: Transaction and SQL errors

2022-04-12 Thread Sebastien Flaesch
Hello, Back on this "feature", I did some experiments by changing the code of our PostgreSQL driver (db connector)... We have our own programming language and VM/runtime. With a config setting (I don't want to enable this by default), our driver now automatically adds a SAVEPOINT before any SQ

Re: Transaction and SQL errors

2022-04-06 Thread Sebastien Flaesch
Hello Gilles and thanks for that link! I will definitively add that info to our issue tracker/db. Seb

Re: Transaction and SQL errors

2022-04-06 Thread Gilles Darold
Le 04/04/2022 à 18:20, Sebastien Flaesch a écrit : David, Personally, I can see where it has significant value for psql in interactive mode because people make typos.  Application code doesn't.  That removes a whole class of problems where the feature provides benefit. Sure, ap

Re: Transaction and SQL errors

2022-04-04 Thread Sebastien Flaesch
David, Personally, I can see where it has significant value for psql in interactive mode because people make typos. Application code doesn't. That removes a whole class of problems where the feature provides benefit. Sure, application code must not have typos, but I prefer to let the DB engi

Re: Transaction and SQL errors

2022-04-04 Thread David G. Johnston
On Mon, Apr 4, 2022 at 5:41 AM Sebastien Flaesch wrote: > > I know savepoints are supported by PostgreSQL, but what about > existing/legacy code that has tons of lines that rely on the behavior of > other DB engines? > > Would you ask programmers to put a savepoint / release savepoint around > ea

Re: Transaction and SQL errors

2022-04-04 Thread J. Roeleveld
On Monday, April 4, 2022 1:44:40 PM CEST David Rowley wrote: > On Mon, 4 Apr 2022 at 23:33, Sebastien Flaesch > > wrote: > > Any arguments I could give to programmers? Maybe: > > "You better replay all SQL of the whole transaction... (and make them as > > short as possible!)" ? > > There are S

Re: Transaction and SQL errors

2022-04-04 Thread Sebastien Flaesch
From: David Rowley Sent: Monday, April 4, 2022 1:44 PM To: Sebastien Flaesch Cc: pgsql-gene...@postgresql.org Subject: Re: Transaction and SQL errors EXTERNAL: Do not click links or open attachments if you do not recognize the sender. On Mon, 4 Apr 2022 at 23:33, Sebastien Flaesch

Re: Transaction and SQL errors

2022-04-04 Thread Sebastien Flaesch
Hi Karsten, No... see the doc: https://www.postgresql.org/docs/14/app-psql.html ON_ERROR_ROLLBACK When set to on, if a statement in a transaction block generates an error, the error is ignored and the transaction continues. Seb

Re: Transaction and SQL errors

2022-04-04 Thread David Rowley
On Mon, 4 Apr 2022 at 23:33, Sebastien Flaesch wrote: > Any arguments I could give to programmers? Maybe: > "You better replay all SQL of the whole transaction... (and make them as > short as possible!)" > ? There are SAVEPOINTs [1]. David [1] https://www.postgresql.org/docs/current/sql-save

Re: Transaction and SQL errors

2022-04-04 Thread Karsten Hilbert
Am Mon, Apr 04, 2022 at 11:33:14AM + schrieb Sebastien Flaesch: > Is there any plan to have an equivalent of psql's > > set ON_ERROR_ROLLBACK on > > in the DB engine? That is already what happens. SQL fails, transaction rolls back. Karsten -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D