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

Re: Bug #671: server corrupt

From: "Heng Sun" <sunheng(at)hotmail(dot)com>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Bug #671: server corrupt
Date: 2002-05-24 18:33:34
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
From the explanation of Tom Lane, it seems we could get around the problem
in this way: avoid using "nextval" etc. on the sequence to be dropped in the
same transaction. The details can be like this. Support we want to drop a
sequence sA and would like to get the next available sA sequence value
before we want to drop it. (This is the situation where Dmitry and I found
this bug.) We would do
1. exec statement "SELECT last_value from sA" to get the last value of this
2. increment this last value
3. drop the sequence sA.

We have seen that this fixed the problem.
I am not sure we can absolutely guarantee that the last value we get this
way would be the same as calling "nextval", since another request might
change the sequence we want to drop (depending on transaction mode?).
However we can live with it since dropping sequence does not happen often at

But my question is: will this completely get around the problem of server
corrupt? In particular, if in a transaction, the "nextval" is called on a
sequence different from the sequence we are trying to drop, would there be a
problem? My tests showed NO problem in this situation. Also the analysis
from Tom Lane seems confirming this. But I am still not sure on this.


Heng Sun


pgsql-bugs by date

Next:From: Tom LaneDate: 2002-05-24 20:13:36
Subject: Re: Bug #671: server corrupt
Previous:From: Michael BeckstetteDate: 2002-05-23 22:41:44
Subject: Re: length limitation in '=' operator when comparing TEXT fields ?

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