Skip site navigation (1) Skip section navigation (2)

Re: How to crash postgres using savepoints

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Joseph Shraibman <jks(at)selectacast(dot)net>, pgsql-bugs(at)postgreSQL(dot)org
Subject: Re: How to crash postgres using savepoints
Date: 2006-11-16 20:59:33
Message-ID: 20061116205933.GO19298@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-general
Tom Lane wrote:

> Actually, I'd say the dubious behavior here is that
> 
> 	SAVEPOINT foo;
> 	SAVEPOINT foo;
> 	SAVEPOINT foo;
> 
> creates three nested savepoints ... it might be better if it
> automatically released any existing savepoint of the same name.
> I notice that the SAVEPOINT reference page says the latter is
> the behavior required by the SQL spec.  Did we explicitly decide
> to do this differently from spec, and if so why?

Yeah, we did.  I think the rationale was what happens when you have
another savepoint in the middle, say

SAVEPOINT foo;
SAVEPOINT bar;
SAVEPOINT foo;

The fact that the third sentence would implicitely release the "bar"
savepoint bothered us.  IIRC Oracle gets away with this because their
savepoints are not actually nested, but sequential (i.e. you can release
"foo" without forgetting about "bar").  I'm not really sure about this.

Maybe we could change the behavior so that establishing a savepoint
releases a savepoint of the same name if it's the direct parent, but
that doesn't follow the KISS principle.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2006-11-16 21:08:02
Subject: Re: How to crash postgres using savepoints
Previous:From: Joseph ShraibmanDate: 2006-11-16 20:59:17
Subject: Re: How to crash postgres using savepoints

pgsql-general by date

Next:From: Tom LaneDate: 2006-11-16 21:01:58
Subject: Re: [HACKERS] Not your father's question about deadlocks
Previous:From: Joseph ShraibmanDate: 2006-11-16 20:59:17
Subject: Re: How to crash postgres using savepoints

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group