By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,731 Members | 1,104 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,731 IT Pros & Developers. It's quick & easy.

Functions and Commits

P: 3
I have been reading through all the threads and trying a few different things. Essentially, I have a function that loops through a table and then performs some updates/inserts against other tables based on the row from the FOR LOOP.

Currently, none of these inserts/updates are visible to other users until the LOOP and function are complete (i.e. the end of the function is the commit).
However, I would like to make these insert/updates visible as soon as a row in the for loop is complete. Is this possible? or is this the problem of a nested transaction?

I am about to try dblink. Is there anyway to accomplish this?
Feb 22 '07 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 534
Nested transactions are (kind of) supported in the latest versions of Postgres.
This involves usage of savepoints and I think it may have a negative impact on performance when you processing a big volume of data.
If you want to try it check out read this

It is quite common to make updates available when entire transaction is complete.
I wonder why are you trying to do this, does this update takes a very long time, or is there some other reason?
Perhaps it would help if you describe the problem before committing to a specific solution, like dblink, or nested transactions.
Feb 23 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.