Hi,
the following handling of backups is surprising:
* db:alter changes the name of the database but does not alter the names of the corresponding backups * db:drop deletes both, the database and the corresponding backups
I would prefer, if there was an option in db:drop to keep the backups, which would allow to restore a deleted database from their backups. Is it possible to add options to db:drop, which allow that?
For me, the behavior of db:alter looks like a bug.
There is another minor handling, i would like to have changed:
* db:info($db)/resourceproperties/inputdate is a UTC dateTime with a time zone offset * db:backups($db)/@date is a local dateTime without a time zone offset
If I compare these two, it works correctly if the local time zone offset is the same as for the creation of the backup E.g.:
if ( not(db:backups($db)) or max(db:backups($db)/@date/(. cast as xs:dateTime)) < db:info($db)/resourceproperties/inputdate/. cast as xs:dateTime ) then db:create-backup($db) else ()
Adding a time zone offset +hh:mm or -hh:mm to db:backups($db)/@date would solve this.
Thanks,
Christoph
Hi Christoph,
Welcome back to the list.
db:drop deletes both, the database and the corresponding backups
The function should only delete database and preserve backups. For deleting backups, db:drop-backup can be used. Maybe there was a bug in an older version of BaseX?
db:info($db)/resourceproperties/inputdate is a UTC dateTime with a time zone offset db:backups($db)/@date is a local dateTime without a time zone offset
Same here: Both returned timezones should be a UTC dateTime with the Z time offset.
Maybe you need to switch to the latest version of BaseX? Feel free to give us an update if the problems persist with BaseX 9.x.
Hope this helps, Christian
Dear Christoph,
A command and an XQuery function for renaming backup files was added in the latest snapshot of BaseX [1,2].
All the best, Christian
[1] https://github.com/BaseXdb/basex/issues/1742 [2] http://files.basex.org/releases/latest/ _______________________________________
On Wed, Oct 16, 2019 at 1:34 PM Christoph Gaukel christoph.gaukel@gmx.de wrote:
Hi,
the following handling of backups is surprising:
db:alter changes the name of the database but does not alter the names of the corresponding backups db:drop deletes both, the database and the corresponding backups
I would prefer, if there was an option in db:drop to keep the backups, which would allow to restore a deleted database from their backups. Is it possible to add options to db:drop, which allow that?
For me, the behavior of db:alter looks like a bug.
There is another minor handling, i would like to have changed:
db:info($db)/resourceproperties/inputdate is a UTC dateTime with a time zone offset db:backups($db)/@date is a local dateTime without a time zone offset
If I compare these two, it works correctly if the local time zone offset is the same as for the creation of the backup E.g.:
if ( not(db:backups($db)) or max(db:backups($db)/@date/(. cast as xs:dateTime)) < db:info($db)/resourceproperties/inputdate/. cast as xs:dateTime ) then db:create-backup($db) else ()
Adding a time zone offset +hh:mm or -hh:mm to db:backups($db)/@date would solve this.
Thanks,
Christoph
basex-talk@mailman.uni-konstanz.de