473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Transaction blocks

Is there a way to continue a transaction after an error? I've got a
situation where I have a transaction open and I'm inserting data, but
some of it could fail on validation. I want to keep the good stuff,
leave out the bad, and get the speed of not having to commit every
record seperately. For a specific example, I'm importing a list of
stocks, but some symbols have changed because the list is old, so there
are invalid symbols in the list that are not found in the master list.
I want to catch the invalid ones and fix them, but still commit the
good ones. Right now I'm committing each record, but it's slow.

=====
"We'll do the undoable, work the unworkable, scrute the inscrutable and have a long, hard look at the ineffable to see whether it might not be effed after all"

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #1
1 1247
On Tue, 2004-08-10 at 14:45, Jonathan Barnhart wrote:
Is there a way to continue a transaction after an error? I've got a
situation where I have a transaction open and I'm inserting data, but
some of it could fail on validation. I want to keep the good stuff,
leave out the bad, and get the speed of not having to commit every
record seperately. For a specific example, I'm importing a list of
stocks, but some symbols have changed because the list is old, so there
are invalid symbols in the list that are not found in the master list.
I want to catch the invalid ones and fix them, but still commit the
good ones. Right now I'm committing each record, but it's slow.


That feature (save points / nested transactions) will be in 8.0, which
just entered beta, however, it will still have the issue that you'll be
making a bunch of transactions, so to speak, so the speed likely won't
be better, just the error handling for what you're trying to do.
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tim Callaghan | last post by:
We have an inhouse replication process which is causing us headaches when we try to run more than one copy of it against the same target database (we support unlimited remote databases so we may...
1
by: Montag | last post by:
I am not a GURU of SQL, and i have to solve this problem, hoping that it can be solved trough the transaction blocks of SQL Server: i have an user who opens a record in order to modify it. i...
1
by: Rittercorp | last post by:
I am debugging an app which blocks many processes in a SQL7 server DB. The app log writes every transaction "open" and "close". The weird thing is : when the app logfile says the transaction is...
6
by: Chris Ochs | last post by:
I want to do a series of inserts within a single transaction block, but with postgresql if one insert fails, the whole block is aborted. Is there any way to get around this behavior so that...
2
by: John Lee | last post by:
Hi, I have few questions related to .NET 2.0 TransactionScope class behavior: 1. Check Transaction.Current.TransactionInformation.DistributedIdentifier to identify if distributed transaction...
15
by: Zeng | last post by:
Hi, The bigger my C# web-application gets, the more places I need to put in the tedious retrying block of code to make sure operations that can run into database deadlocks are re-run (retried)...
9
by: John Sidney-Woollett | last post by:
Is it possible to use the dblink and dblink_exec features from inside pl/pgsql functions to mimic the behaviour of nested transactions by calling another function or executing some SQL via the...
2
by: ruben20 | last post by:
Hi: I've migrated a couple of weeks ago from 7.4.2 to 7.4.5 and I am getting this error after executing a query: Warning: pg_exec() query failed: ERROR: could not access status of transaction...
2
by: Phil Endecott | last post by:
Dear All, Within a transaction, now() and current_timestamp are constant and give the time that the transaction started. This is normally what you want. But I have a case where I actually need...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
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,...
0
jinu1996
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.