Transaction blocks
Question posted by: Jonathan Barnhart
(Guest)
on
November 23rd, 2005 01:35 AM
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
1
Answer Posted
On Tue, 2004-08-10 at 14:45, Jonathan Barnhart wrote:[color=blue]
> 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.[/color]
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
|
|
|
What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 196,932 network members.
Top Community Contributors
|