Re: [Python-Dev] bsddb todo for someone - auto-upgrade db format

On Thu, Oct 21, 2004 at 12:49:19PM +0400, Oleg Broytmann wrote:
BTW, just installing is not enough, even when it is come with Python distribution. Installing a newer version of BerkeleyDB breaks older databases due to incompatible file formats.
fwiw its possible to fix this in the bsddb code. someone willing to do the exception catching database backing-up + auto db_upgrade() work should submit a patch. (i added backing-up as its rude to auto-convert someones database for them to a version their old software can no longer read) -g

On Thu, Oct 28, 2004 at 01:44:43AM -0700, Gregory P. Smith wrote:
On Thu, Oct 21, 2004 at 12:49:19PM +0400, Oleg Broytmann wrote:
BTW, just installing is not enough, even when it is come with Python distribution. Installing a newer version of BerkeleyDB breaks older databases due to incompatible file formats.
fwiw its possible to fix this in the bsddb code. someone willing to do the exception catching database backing-up + auto db_upgrade()
What's db_upgrade()? I can find only a reference to a program called db_upgrade, and I don't have one on my computer. Oleg. -- Oleg Broytmann http://phd.pp.ru/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.

"Oleg" == Oleg Broytmann <phd@oper.phd.pp.ru> writes:
Oleg> What's db_upgrade()? I can find only a reference to a program Oleg> called db_upgrade, and I don't have one on my computer. It's a program that comes with recent versions of Berkeley DB to upgrade files written in older formats to the current format (the format associated with the version of db_upgrade being run). Skip

On Thu, Oct 28, 2004 at 06:21:45AM -0500, Skip Montanaro wrote:
"Oleg" == Oleg Broytmann <phd@oper.phd.pp.ru> writes: Oleg> What's db_upgrade()?
It's a program that comes with recent versions of Berkeley DB to upgrade files written in older formats to the current format (the format associated with the version of db_upgrade being run).
So it has to be distributed with Python. I am very nervous about automagically running a program in the background upon catching a data format exception in bsddb module. What if the program fails? Where the module will put its stderr? popen+raise FormatError(caught_error_string)? I am in favour of including the program in the Python distribution (if its license allows inclusion) but not to run it automatically. This is the job for an application, not for the bsddb module. Oleg. -- Oleg Broytmann http://phd.pp.ru/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.

On Thu, Oct 28, 2004 at 02:05:13PM +0400, Oleg Broytmann wrote:
On Thu, Oct 28, 2004 at 01:44:43AM -0700, Gregory P. Smith wrote:
On Thu, Oct 21, 2004 at 12:49:19PM +0400, Oleg Broytmann wrote:
BTW, just installing is not enough, even when it is come with Python distribution. Installing a newer version of BerkeleyDB breaks older databases due to incompatible file formats.
fwiw its possible to fix this in the bsddb code. someone willing to do the exception catching database backing-up + auto db_upgrade()
What's db_upgrade()? I can find only a reference to a program called db_upgrade, and I don't have one on my computer.
http://www.sleepycat.com/docs/api_c/db_upgrade.html Its part of the sleepycat database API to upgrade from old formats to new. When you build BerkeleyDB it does create a standalone command line utility that'll call the function for you but its also available thru the C (and python) api. See the bsddb.db.DB.upgrade() method.

Gregory P. Smith wrote:
On Thu, Oct 21, 2004 at 12:49:19PM +0400, Oleg Broytmann wrote:
BTW, just installing is not enough, even when it is come with Python distribution. Installing a newer version of BerkeleyDB breaks older databases due to incompatible file formats.
fwiw its possible to fix this in the bsddb code. someone willing to do the exception catching database backing-up + auto db_upgrade() work should submit a patch. (i added backing-up as its rude to auto-convert someones database for them to a version their old software can no longer read)
Automatically converting the database is a bad idea. bsddb does too much implicitly already, like installing. Wishing I could run the tests without segfaultingly yours, Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org
participants (4)
-
Gregory P. Smith
-
Jim Fulton
-
Oleg Broytmann
-
Skip Montanaro