![]() | |
#41
| |||
| |||
|
|
That is not a good alternative. Nested transactions are meant to be able to call stored procedures that contain a transaction from inside another transaction without ending the outer transaction or raising an error unexpectedly. This could happen at indefinite nesting levels. |
#42
| |||
| |||
|
|
It all depends on what you mean by "nested transaction". My original assumption was that the original post meant something like "autonomous transactions" in Oracle, which you cannot have in PostgreSQL. My suggestion was based on the sample that was posted - I believe that this can be done with savepoints. I do not understand your explanation, so I cannot say if this can be achieved with savepoints or not. There are of course things that will not be possible in PostgreSQL. If somebody has a good idea that fits in well with the existing functionality and is as standard compliant as possible, it might be a good idea to suggest it on the pgsql-hackers mailing list. Best is to have an idea how it might work and what benefits will arise from implementing it. Yours, Laurenz Albe |
#43
| |||
| |||
|
|
It all depends on what you mean by "nested transaction". My original assumption was that the original post meant something like "autonomous transactions" in Oracle, which you cannot have in PostgreSQL. My suggestion was based on the sample that was posted - I believe that this can be done with savepoints. I do not understand your explanation, so I cannot say if this can be achieved with savepoints or not. There are of course things that will not be possible in PostgreSQL. If somebody has a good idea that fits in well with the existing functionality and is as standard compliant as possible, it might be a good idea to suggest it on the pgsql-hackers mailing list. Best is to have an idea how it might work and what benefits will arise from implementing it. Yours, Laurenz Albe |
#44
| |||
| |||
|
|
It all depends on what you mean by "nested transaction". My original assumption was that the original post meant something like "autonomous transactions" in Oracle, which you cannot have in PostgreSQL. My suggestion was based on the sample that was posted - I believe that this can be done with savepoints. I do not understand your explanation, so I cannot say if this can be achieved with savepoints or not. There are of course things that will not be possible in PostgreSQL. If somebody has a good idea that fits in well with the existing functionality and is as standard compliant as possible, it might be a good idea to suggest it on the pgsql-hackers mailing list. Best is to have an idea how it might work and what benefits will arise from implementing it. Yours, Laurenz Albe |
#45
| |||
| |||
|
|
It all depends on what you mean by "nested transaction". My original assumption was that the original post meant something like "autonomous transactions" in Oracle, which you cannot have in PostgreSQL. My suggestion was based on the sample that was posted - I believe that this can be done with savepoints. I do not understand your explanation, so I cannot say if this can be achieved with savepoints or not. There are of course things that will not be possible in PostgreSQL. If somebody has a good idea that fits in well with the existing functionality and is as standard compliant as possible, it might be a good idea to suggest it on the pgsql-hackers mailing list. Best is to have an idea how it might work and what benefits will arise from implementing it. Yours, Laurenz Albe |
#46
| |||
| |||
|
|
It all depends on what you mean by "nested transaction". My original assumption was that the original post meant something like "autonomous transactions" in Oracle, which you cannot have in PostgreSQL. My suggestion was based on the sample that was posted - I believe that this can be done with savepoints. I do not understand your explanation, so I cannot say if this can be achieved with savepoints or not. There are of course things that will not be possible in PostgreSQL. If somebody has a good idea that fits in well with the existing functionality and is as standard compliant as possible, it might be a good idea to suggest it on the pgsql-hackers mailing list. Best is to have an idea how it might work and what benefits will arise from implementing it. Yours, Laurenz Albe |
#47
| |||
| |||
|
|
It all depends on what you mean by "nested transaction". My original assumption was that the original post meant something like "autonomous transactions" in Oracle, which you cannot have in PostgreSQL. My suggestion was based on the sample that was posted - I believe that this can be done with savepoints. I do not understand your explanation, so I cannot say if this can be achieved with savepoints or not. There are of course things that will not be possible in PostgreSQL. If somebody has a good idea that fits in well with the existing functionality and is as standard compliant as possible, it might be a good idea to suggest it on the pgsql-hackers mailing list. Best is to have an idea how it might work and what benefits will arise from implementing it. Yours, Laurenz Albe |
#48
| |||
| |||
|
|
It all depends on what you mean by "nested transaction". My original assumption was that the original post meant something like "autonomous transactions" in Oracle, which you cannot have in PostgreSQL. My suggestion was based on the sample that was posted - I believe that this can be done with savepoints. I do not understand your explanation, so I cannot say if this can be achieved with savepoints or not. There are of course things that will not be possible in PostgreSQL. If somebody has a good idea that fits in well with the existing functionality and is as standard compliant as possible, it might be a good idea to suggest it on the pgsql-hackers mailing list. Best is to have an idea how it might work and what benefits will arise from implementing it. Yours, Laurenz Albe |
#49
| |||
| |||
|
|
It all depends on what you mean by "nested transaction". My original assumption was that the original post meant something like "autonomous transactions" in Oracle, which you cannot have in PostgreSQL. My suggestion was based on the sample that was posted - I believe that this can be done with savepoints. I do not understand your explanation, so I cannot say if this can be achieved with savepoints or not. There are of course things that will not be possible in PostgreSQL. If somebody has a good idea that fits in well with the existing functionality and is as standard compliant as possible, it might be a good idea to suggest it on the pgsql-hackers mailing list. Best is to have an idea how it might work and what benefits will arise from implementing it. Yours, Laurenz Albe |
#50
| |||
| |||
|
|
Let's say both stored procedures A and B start with a "begin transaction" and end with a "commit". This makes them atomic to their direct users. However, if I where to write stored procedure C that would like to call both A and B and be atomic itself then I would like to begin a transaction, call a, call b and then do the commit. When calling C the only "actual" transaction is the one in C itself. The ones in A and B would only be savepoints for rollbacks inside A or B, commits in A and B should be ignored. Not that I think this is the right way to write stored procedures but I have had to do some extensions on an existing system where this would have been very useful. I ended up ripping apart some existing stored procedures to fix the transaction logic of the new stored procedures while leaving the existing stuff as untouched as possible. I had to do a lot of extra testing because of this. |
![]() |
| Thread Tools | |
| Display Modes | |
| |