I just read this in the MySQL manual:
( http://dev.mysql.com/doc/mysql/en/In..._handling.html)
"Error handling in InnoDB is not always the same as specified in the SQL
standard. According to the standard, any error during an SQL statement
should cause the rollback of that statement. InnoDB sometimes rolls back
only part of the statement, or the whole transaction. The following items
describe how InnoDB performs error handling:"
Ignore InnoDB, but read "According to the standard, any error during an SQL
statement should cause the rollback of that statement"...
I though the postgres behaviour of rolling back the whole transaction was
standard? If that is not the case, I don't understand why core seems to be
against a mode (GUC), where an implicit savepoint is generated before each
statement so that "rollback of the last statement" would be possible.
Is MySQL wrong on the standard, or has postgresql core attitude changed to
support the standard where possible - at least if the user wants?
Best Regards,
Michael Paesold
P.S: again thanks for PostgreSQL!
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org 8 3878
On Tue, Sep 14, 2004 at 11:39:32AM +0200, Michael Paesold wrote: I though the postgres behaviour of rolling back the whole transaction was standard? If that is not the case, I don't understand why core seems to be against a mode (GUC), where an implicit savepoint is generated before each statement so that "rollback of the last statement" would be possible.
Well. If such a mode ever becomes available I'll be looking into how to
make sure it never gets turned on. My mind is currently boggling at the
number of things it would break.
A transaction is either committed as a whole, without errors, or not at
all. If you want to do a savepoint after each statement, go right
ahead, nothing is stopping you. I just don't think making it any kind
of default is a very good idea...
--
Martijn van Oosterhout <kl*****@svana. org> http://svana.org/kleptog/ Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a tool for doing 5% of the work and then sitting around waiting for someone else to do the other 95% so you can sue them.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQFBRr+MY5T wig3Ge+YRAoC3AJ 9dcQ3buvSAZ/kVTgL9HQuHdkWCU ACeIjXp
lqhKpNbi5kLWRJj aQ5dbVhc=
=wqxC
-----END PGP SIGNATURE-----
Michael Paesold wrote: I though the postgres behaviour of rolling back the whole transaction was standard?
No.
If that is not the case, I don't understand why core seems to be against a mode (GUC), where an implicit savepoint is generated before each statement so that "rollback of the last statement" would be possible.
Because it's dangerous in noninteractive mode. When you send a
transaction to the server, you don't want some statements be left out.
--
Peter Eisentraut http://developer.postgresql.org/~petere/
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
Peter Eisentraut wrote: Michael Paesold wrote: I though the postgres behaviour of rolling back the whole transaction was standard?
No.
Thanks for putting that straigt. If that is not the case, I don't understand why core seems to be against a mode (GUC), where an implicit savepoint is generated before each statement so that "rollback of the last statement" would be possible.
Because it's dangerous in noninteractive mode. When you send a transaction to the server, you don't want some statements be left out.
I understand it's dangerous, it would possibly introduce data-inconsistency
in all applications that don't check for errors after each statement...
Still it would be very useful in interactive psql...
of course, it's bad in scripted mode. Perhaps it could be implemented inside
psql? Would such a patch be accepted?
Regards,
Michael Paesold
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives? http://archives.postgresql.org
On Tue, 2004-09-14 at 11:56, Peter Eisentraut wrote: Michael Paesold wrote: I though the postgres behaviour of rolling back the whole transaction was standard?
No.
If that is not the case, I don't understand why core seems to be against a mode (GUC), where an implicit savepoint is generated before each statement so that "rollback of the last statement" would be possible.
Because it's dangerous in noninteractive mode. When you send a transaction to the server, you don't want some statements be left out.
But it does not mean the server will commit the transaction for you...
it will throw an exception on the failed query, and it's up to you to
continue the transaction, commit it right away, or to roll it back. Old
code will probably just work fine if it will roll back on any received
error, which it had to do anyway even with the current behavior.
So it is just giving more choice to the developer instead of deciding
for him that the transaction is failed... and yes, there are valid
scenarios where it is quicker to execute a query and based on the fact
that it fails or not do different things, without the need of redoing
the whole transaction executed before.
It's another story that this feature should not be turned on by default
if it has some performance overhead (which I suppose it has, as setting
a savepoint is probably not free).
Just my 2c,
Csaba.
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org
On 14/09/2004 10:39 Michael Paesold wrote: I just read this in the MySQL manual: (http://dev.mysql.com/doc/mysql/en/In..._handling.html)
"Error handling in InnoDB is not always the same as specified in the SQL standard. According to the standard, any error during an SQL statement should cause the rollback of that statement. InnoDB sometimes rolls back only part of the statement, or the whole transaction. The following items describe how InnoDB performs error handling:"
Ignore InnoDB, but read "According to the standard, any error during an SQL statement should cause the rollback of that statement"...
I though the postgres behaviour of rolling back the whole transaction was standard? If that is not the case, I don't understand why core seems to be against a mode (GUC), where an implicit savepoint is generated before each statement so that "rollback of the last statement" would be possible.
Is MySQL wrong on the standard, or has postgresql core attitude changed to support the standard where possible - at least if the user wants?
Well, you could go off and read the standards of course but I'll save you
the time and tell you that PostrgreSQL does it correctly.
But seriously, are you so naive that you would believe _anything_ MySQL AB
say?
--
Paul Thomas
+------------------------------+-------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for Business |
| Computer Consultants | http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+-------------------------------------------+
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org
"Michael Paesold" <mp******@gmx.a t> writes: I though the postgres behaviour of rolling back the whole transaction was standard?
Not really.
If that is not the case, I don't understand why core seems to be against a mode (GUC), where an implicit savepoint is generated before each statement so that "rollback of the last statement" would be possible.
Because we learned our lesson with the ill-fated autocommit GUC
variable. You can't have fundamental transactional semantics depending
on the phase of the moon, but from the point of view of application
code, anything that can be flipped as easily as a GUC variable is an
unknown.
If you've been following recent -hackers discussions you will also
realize that a forced savepoint for every statement is untenable
from a performance perspective anyway.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
Tom Lane wrote: "Michael Paesold" <mp******@gmx.a t> writes:
.... If that is not the case, I don't understand why core seems to be against a mode (GUC), where an implicit savepoint is generated before
each statement so that "rollback of the last statement" would be possible.
Because we learned our lesson with the ill-fated autocommit GUC variable. You can't have fundamental transactional semantics depending on the phase of the moon, but from the point of view of application code, anything that can be flipped as easily as a GUC variable is an unknown.
If you've been following recent -hackers discussions you will also realize that a forced savepoint for every statement is untenable from a performance perspective anyway.
Well, I read the threads "Re: beta1 & beta2 & Windows & heavy load" and
"Cleaning up recovery from subtransaction start failure".
I see, that savepoint/subxacts are rather expensive, at least wrt
shared-memory (lock on xid).
On the other hand, the scenario of a psql option (read: I have given up the
idea of a backend implementation) to rollback only last statement on error
is quite different.
In the mentioned thread, several thousand rows where deleted, each firing a
trigger creating a subxact. But in usual interactive administrative
sessions, you would perhaps have 5 to 20 statements in a usual transaction.
At least according to my personal experience.
Am I right in asserting that psql could recognize if a session is
interactive or scripted (\i, psql < script.sql)? And it already has user
settable options, (\set, e.g. autocommit)...
So a proper patch implementing a corresponding mode in psql that wraps each
statement (of a multi statement transaction) in a subxact, if the user
enables it, would be accepted or even called welcome?
Just thinking about...
BEGIN;
SET TRANSACTION ISOLATION SERIALIZABLE;
SELECT * FROM a WHERE id = 5;
UPDATE a SET .... WHERE id = 5;
-- check everything is ok...
SELEC * FROM a WHERE id = 5;
--> ERROR: syntax error at or near "SELEC" at character 1
-- arghh... typo do it all over again...
Best Regards,
Michael Paesold
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
"Michael Paesold" <mp******@gmx.a t> writes: Tom Lane wrote: "Michael Paesold" <mp******@gmx.a t> writes: If that is not the case, I don't understand why core seems to be against a mode (GUC), where an implicit savepoint is generated before each statement so that "rollback of the last statement" would be possible. Because we learned our lesson with the ill-fated autocommit GUC variable. You can't have fundamental transactional semantics depending on the phase of the moon, but from the point of view of application code, anything that can be flipped as easily as a GUC variable is an unknown.
On the other hand, the scenario of a psql option (read: I have given up the idea of a backend implementation) to rollback only last statement on error is quite different.
Sure (and we already have one for autocommit). But I thought you were
asking about a backend implementation.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: tkestell |
last post by:
Is their anyway to perform mass deletes (several million records) without
"maxing out" rollback segments?
I'm working on archiving data from an Oracle 8.1.7 database The system is
about 4 years old and no data has EVER been archived /removed. So the
two largest tables contain well over 25 million records!
As part of the archive process I'm deleting out-dated records, but because
of the sheer volume keep receiving "Unable to extend...
|
by: Alice |
last post by:
Hi all,
I have a problem with rollback segment. I am a beginner and do not have
much knowledge of DBA.
Anyways, the problem is there is a transaction of around 105 MB. This would
not fit into the normal rollbacks created and gave an error of "maxextents
for rollback reached", so our DBA created a rollback of 500 MB and I used
this rollback for the transaction by using the "set transaction" command.
But even then the error continued....
|
by: Brent Mondoux |
last post by:
Hey everyone,
I have a set of stored procedures that call each other to perform a
set of tasks. I have decided to do this for database performance
reasons rather than doing it from a ColdFusion page (and to prevent
timeouts, etc.)
These stored procedures run every night and handle scheduled tasks in
a complex system.
|
by: level8 |
last post by:
Hi, Everybody,
I'm a Hungarian SQL user and I need a little help for SQL Server 7 !
I protect my table against bad data with a trigger. I use ROLLBACK and
RAISERROR statement in this trigger. Users can get my error message
after manual input, but the stored procedure always cancel because of
ROLLBACK. So the input program dont't have chance to analyze the error
message. I could work without ROLLBACK, but it wouldn't be the best...
|
by: Joăo Santa Bárbara |
last post by:
Hi all
i have this problem .
i have 2 tables ( they are not master detail ) 2 simple tables, and i´m
doing a simple update just like this
try
Trans = Con.BeginTransaction
..........
DataAdpater1.Update(Table1) -> '10 rows Inserted in DataBase
| |
by: Jim Heavey |
last post by:
I have tested a procedure in TOAD and it functions as expected, meaning for
this particular transaction it returns and error message and performs a
rollback within the procedure.
When I call this stored procedure from within ASP.Net with the same data,
The procedure returns an error which is caught by my try-catch block and it
provides the following message...""Detail Error Message: ORA-02074: cannot
ROLLBACK in a distributed...
|
by: Ian Boyd |
last post by:
We're encountering a situation where we're encountering a deadlock, and
someone's been made the deadlock victim. But after that, DB2 refuses to run
any SQL, and instead we get the error message:
"Application must execute a rollback. The unit of work has already been
rolled back in the database but other resource managers involved in this
unit of work might not. To ensure integrity of this application, all SQL
requests will be rejected...
|
by: NarutoFanatic |
last post by:
Hello,
I'm having trouble using a transaction - rollback statement in sql. I can't seem to have the rollback executed during an error when i've altered a table to add a column with the same name (run the alter script twice on purpose to test the rollback). Somehow i got an error of the column should be unique (since the column already added during the 1st execution of the script). I want the sql execution to display the Failed instead and...
|
by: Laurence |
last post by:
Hi,
DB2/400 seems not able to auto-rollback one of transactions while
dead-
lock occurred.
I called the procecure QSYS.CREATE_SQL_SAMPLE for creating sample
database, and used ISQL (STRSQL) & Navigator (Run SQL Scripts) to
evaluate it:
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |