From: Phil Frost <phil@macprofessionals.com>
To: Michael Cochez <michaelcochez@yahoo.com>
Cc: pgsql-docs@postgresql.org
Subject: Re: error in documentation?
Date: Mon, 24 Sep 2007 10:15:57 -0400
Message-ID: <1375DFC2-C35B-4B89-B26D-4031C0E14E79@macprofessionals.com> (raw)
In-Reply-To: <71337.93299.qm@web33515.mail.mud.yahoo.com>
References: <71337.93299.qm@web33515.mail.mud.yahoo.com>
On Sep 24, 2007, at 10:03 , Michael Cochez wrote:
> In http://www.postgresql.org/docs/8.2/static/tutorial-
> transactions.html
> "After rolling back to a savepoint, it continues to be defined, so
> you can roll back to it several times. Conversely, if you are sure
> you won't need to roll back to a particular savepoint again, it can
> be released, so the system can free some resources. Keep in mind
> that either releasing or rolling back to a savepoint will
> automatically release all savepoints that were defined after it."
> mustn't it be :
> "After rolling back to a savepoint, it continues to be defined, so
> you can roll back to it several times. Conversely, if you are sure
> you won't need to roll back to a particular savepoint again, it can
> be released, so the system can free some resources. Keep in mind
> that rolling back to a savepoint will automatically release all
> savepoints that were defined after it and releasing a savepoint
> will automatically release all savepoints defined before it."
>
> if not, could you please explain why this decision is made?
> thanks,
> Michael
If I do:
savepoint one;
update foo set bar = 2;
savepoint two;
update baz set foo = 3;
savepoint three;
delete from foo;
Why would it make sense to release "one" if i release "two"? If I
release "two", then it makes sense that I can never go back to "two"
or "three", but your proposed change means that if I release "two", I
can later rollback to "three" but not to "one". I don't see how
that's useful.
Essentially what the docs say is that savepoints are created on a
stack, and when you do something to to a savepoint "s", you
implicitly do the same thing to all the other savepoints above "s".
Or, if you think of them being nested:
savepoint one {
update foo set bar = 2;
savepoint two {
update baz set foo = 3;
savepoint three {
delete from foo;
...
}
...
}
...
}
then any operation on a savepoint also applies to any savepoints
nested within it.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: phil@macprofessionals.com, michaelcochez@yahoo.com
Subject: Re: error in documentation?
In-Reply-To: <1375DFC2-C35B-4B89-B26D-4031C0E14E79@macprofessionals.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox