Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 01F9F9F9FF0 for ; Mon, 24 Sep 2007 11:42:20 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 27631-08 for ; Mon, 24 Sep 2007 11:42:09 -0300 (ADT) X-Greylist: delayed 00:26:15.34005 by SQLgrey-1.7.5 Received: from macprofessionals.com (66.238.128.226.ptr.us.xo.net [66.238.128.226]) by postgresql.org (Postfix) with ESMTP id 6F5549F9FEC for ; Mon, 24 Sep 2007 11:42:15 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by macprofessionals.com (Postfix) with ESMTP id 62748A52EB9; Mon, 24 Sep 2007 10:15:46 -0400 (EDT) Received: from macprofessionals.com ([127.0.0.1]) by localhost (webserv.macprofessionals.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 27523-05; Mon, 24 Sep 2007 10:15:40 -0400 (EDT) Received: from [172.20.20.52] (unknown [172.20.20.52]) by macprofessionals.com (Postfix) with ESMTP id 07013A52E7B; Mon, 24 Sep 2007 10:15:40 -0400 (EDT) In-Reply-To: <71337.93299.qm@web33515.mail.mud.yahoo.com> References: <71337.93299.qm@web33515.mail.mud.yahoo.com> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <1375DFC2-C35B-4B89-B26D-4031C0E14E79@macprofessionals.com> Cc: pgsql-docs@postgresql.org Content-Transfer-Encoding: 7bit From: Phil Frost Subject: Re: error in documentation? Date: Mon, 24 Sep 2007 10:15:57 -0400 To: Michael Cochez X-Mailer: Apple Mail (2.752.3) X-Virus-Scanned: by amavisd-new at macprofessionals.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/19 X-Sequence-Number: 4417 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.