From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#59346: Adding sqlite-backup Date: Sat, 19 Nov 2022 00:07:33 -0800 Message-ID: References: <837czsd7sr.fsf@gnu.org> <83h6ywbgo5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23481"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59346@debbugs.gnu.org To: Eli Zaretskii , Andrew Hyatt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 19 09:09:02 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1owIuM-0005tL-4E for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Nov 2022 09:09:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owIu7-0007nk-UA; Sat, 19 Nov 2022 03:08:54 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owItP-0007jx-Al for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2022 03:08:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1owItO-0006DK-Ee for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2022 03:08:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1owItO-0001R8-5k for bug-gnu-emacs@gnu.org; Sat, 19 Nov 2022 03:08:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Nov 2022 08:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59346 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix Original-Received: via spool by 59346-submit@debbugs.gnu.org id=B59346.16688452625490 (code B ref 59346); Sat, 19 Nov 2022 08:08:02 +0000 Original-Received: (at 59346) by debbugs.gnu.org; 19 Nov 2022 08:07:42 +0000 Original-Received: from localhost ([127.0.0.1]:38920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owIt3-0001QT-PE for submit@debbugs.gnu.org; Sat, 19 Nov 2022 03:07:42 -0500 Original-Received: from mail-oi1-f177.google.com ([209.85.167.177]:42497) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owIt1-0001Q1-GS for 59346@debbugs.gnu.org; Sat, 19 Nov 2022 03:07:40 -0500 Original-Received: by mail-oi1-f177.google.com with SMTP id q186so7760174oia.9 for <59346@debbugs.gnu.org>; Sat, 19 Nov 2022 00:07:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=qHIf9rAn+WQ1TjPmJwwJtr97KH5SJY0+9EbIHPO/MIw=; b=qTuPFK7CuER61BL3sQ4hxvfx/FVHhcDIejuZWSpPYJYnoQfrKD80L5R9h2e6wLe4LZ 0kgYKHMS6epcxBJC/fRTdXQBP9/tW129FHruRGrEqA69vFBf1PwBypNVnDrx8BmRFIaD TmvQ2t1ZHb3Yk3e+k3cid2byQ3XH/dnBGIWaorXkYT9j7kh+cb2Lfc89XyQRe34QufE5 4wEXSMpSld2ppHPgofpeZ8dORMBA53GKchbZrCtHTMstU4DTrgky3K+jgd6EY4Hn87lJ FI5hfZEspKmuG9rwC9QavXIWnatLz/GSaGPx9dGaMyDdkWYkxu8hgdi0v36I3BF353vZ U63w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qHIf9rAn+WQ1TjPmJwwJtr97KH5SJY0+9EbIHPO/MIw=; b=DYiyZatXvQf5eL626PFbbx+itar7BFTn+uAqAbRNuwukEYGFW20FGoZoo7NIJGTJEC 12lKnjTYb0nYZyPbUqDJqqBR3NXDoHP/Je58/ZzCW8HnsbfE0y+2iFaISElBtcyX3qUI aGyG9cWgMuUihZcJTA46IYCavfjawySlouT5gFgKKDAK2Rxbs3+4aS2KfLdKEjTlWqw/ 4MUgLlpnyqqyBl2KQRRE4fpJhw7d2tM7kn9dg88Ze7rcXw8vhTp9Vftl3yoPjtDPSJc8 MQiGrYPuRAMI/9DNt3n1aDoE9t02jQs8Yp/+OQxmbpTXUNzVB4hGLmeHhoXLI9staPc/ e74w== X-Gm-Message-State: ANoB5pk3UJ3GlXACT+6Pa5Fi9TdRutjYfRvB5Hrq8yO/ycIVCKzAmLzM Smmrbye9/8yLUrUwsUMgDV3IpNCoMkyf8Pf92ho= X-Google-Smtp-Source: AA0mqf4IW7MEF3CgpaEDu7jzaIMT7A2hhMG1keA/7xRyxJzJDT6FcCPOknmEUtyaRBZ7UcyY+FTE6KRp3g2UKSlJod8= X-Received: by 2002:a05:6808:2229:b0:35b:2b17:af81 with SMTP id bd41-20020a056808222900b0035b2b17af81mr4978916oib.199.1668845253792; Sat, 19 Nov 2022 00:07:33 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 19 Nov 2022 00:07:33 -0800 In-Reply-To: <83h6ywbgo5.fsf@gnu.org> X-Hashcash: 1:20:221119:59346@debbugs.gnu.org::FqeXsxne05w8NVKi:9vJb X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:248318 Archived-At: Eli Zaretskii writes: > A database is not like a normal file, and so the fact that Emacs has > backups doesn't seem to be a reason good enough to extend the backups > to DB operations. We don't bother with this when we send email or do > other operations. We also have auto-save and file-locks for normal > file, but not for DBs. And a DB is not a file, it is a (large) > collection of tables and records, and Emacs deals with at most a > single table at a time, AFAIU. IME, one key difference between sqlite and a more fully-featured RDBMS like MySQL or PostgreSQL is that it is much easier to induce a corruption. It is true that, as long as we don't have bugs in Emacs or sqlite, we should rarely see any issues. (If anyone does run into any bugs, they will thank us for providing a backup though.) But since this is Emacs, and users are used to be able to just copy and move files around inside of ~/.emacs.d, it is not unlikely that they will treat the sqlite database file in the same way. Especially if they are not familiar with how sqlite works. As we know, copying the file around as its being written is one way of corrupting the database.[1] This is just one example of how a corruption could happen. Now, we could call this a "pilot error" and be done with it, or we could try to provide some safety net. I think the latter is preferable. > More generally, DB administration is outside of the Emacs scope, and > how to do that properly is outside our expertise. There's more to it > than just backing up the DB. AFAIU, the concern here is data safety, for which backups should be good enough. But I don't know what other types of DB administration tasks you have in mind. > you can backup the DB by using the sqlite3 executable. I think it is > reasonable to expect users who want to backup their DB to have this > executable and use it for that purpose If it can be avoided, it would be better to not put that burden on individual users. For the same reasons we provide autosave files, backup files, etc. Footnotes: [1] https://www.sqlite.org/howtocorrupt.html