469,088 Members | 1,274 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,088 developers. It's quick & easy.

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 1134
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Montag | last post: by
6 posts views Thread by Chris Ochs | last post: by
15 posts views Thread by Zeng | last post: by
9 posts views Thread by John Sidney-Woollett | last post: by
2 posts views Thread by Phil Endecott | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.