Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6y0L-0002Qy-RQ for pgsql-admin@arkaria.postgresql.org; Fri, 23 Jul 2021 16:26:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m6y0K-0006DU-8m for pgsql-admin@arkaria.postgresql.org; Fri, 23 Jul 2021 16:26:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m6y0J-0006AT-R3 for pgsql-admin@lists.postgresql.org; Fri, 23 Jul 2021 16:26:27 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m6y0C-0003xj-ID for pgsql-admin@lists.postgresql.org; Fri, 23 Jul 2021 16:26:27 +0000 Received: by mail-wr1-x42a.google.com with SMTP id w12so2910058wro.13 for ; Fri, 23 Jul 2021 09:26:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=tI+bbiaFVoFR5S6ApxjJuw3jGyJ/sGjt/d7+OBrrUrk=; b=QHuc9XoH+Zp6TJ47/2loRbeDuRnKMYh+v9b659KSt0KcnIpc+/qNVrISndNdGRs6Fp XF8WHgdiHt6b5dh+ofNLwPmltaafJxC9CSMiWTqhx2BdKtHR/B/bHe9GLMyL0fSMsxaS jLuMqSWOwO4cv7GeE0Tclo5x2/UWrucasGPLq4ZgTZrhSHe4Bo7fTtnhDIct0TOEl2yk OxvTvahzhBPIgEUtiL64kXBy4RJIYXCInfT6dY441sYW2YJS+pYTwEo/thykFkQp4CnP dW3EO+v3eeTh3qrq8gZIwoN4sQqCUdV8l6lSuwzot8f+w4OItStdmfUrGHlwB1cjSkEc v7ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=tI+bbiaFVoFR5S6ApxjJuw3jGyJ/sGjt/d7+OBrrUrk=; b=BTSOQqIEFshGhby96FGQ1fi0Vjq8JlZOQF55Z/REsr5R+DkdlOVI2sp4+r+93RNjwC ZC3JCov8AOhPrOyTjE5gtPyF8NYtTI5NV46GJuO+zQYgGThda+dCPw24ZmFrSDL2wtNI 8q2uRCwgvn/MJwYXzZGKGMzJBdqxSxwFOuPLkSUfSHvboy3E7O/AdlGQdwl3E0JNGiXB VEq8YEGHREIHkheZU/l/uVb2VAlUsZ6G13xs0chNuWcfYJ+bxQURMr7zCbfZ+dDPy149 c5OEY9rEN+/vjUnbpPvPSZScN6Ia8jeU95piTBk2DpbTKKhDC85j3DUj7qGLNf3XBCgP eP2w== X-Gm-Message-State: AOAM531ervHhRchjKNDPFeYQnvN9yEC5BA+svEVxn5vx7zfz+SZruOPQ RR/Ew9Mi6fT5bzLmGJjsK5Vj1g== X-Google-Smtp-Source: ABdhPJz2oW9wqOGBks/PV/EtRcmrV+9JePinlZb69s4E6/QY1dufvxrElo+r/c8jfwHfy+/n633ZTQ== X-Received: by 2002:a5d:528d:: with SMTP id c13mr6310866wrv.343.1627057579370; Fri, 23 Jul 2021 09:26:19 -0700 (PDT) Received: from localhost.localdomain (91-115-147-4.adsl.highway.telekom.at. [91.115.147.4]) by smtp.gmail.com with ESMTPSA id j4sm19593199wrt.24.2021.07.23.09.26.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jul 2021 09:26:18 -0700 (PDT) Message-ID: <32a24a871174e9362225be407a234251e837d9aa.camel@cybertec.at> Subject: Re: What's the dfifference between pg_start_backup+copy+pg_stop_backup+WAL vs. pg_start_backup+pg_stop_backup+copy+WAL? From: Laurenz Albe To: Thorsten =?ISO-8859-1?Q?Sch=F6ning?= , pgsql-admin@lists.postgresql.org Date: Fri, 23 Jul 2021 18:26:18 +0200 In-Reply-To: <1751752722.20210723161202@am-soft.de> References: <1208702063.20210723115638@am-soft.de> <399c734c5b9ffe10f68bcb79a69bea000d8d0c21.camel@cybertec.at> <1751752722.20210723161202@am-soft.de> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2021-07-23 at 16:12 +0200, Thorsten Schöning wrote: > I think your example is bad: If both rows are added in independent > transactions, possibly inconsistent table data simply needs to be > accepted. No backup mechanism will change anything on that, because > the second row might always be inserted "too late". Stephen has already pointed out the flaws in your reasoning, so let me illustrate my example in more detail: You add the rows in A and B in two different transactions: first the row in A, then the dependent row in B. At that time the data file for A has already been backed up. After both rows are committed, the data file for B is backed up. Now if you replay WAL to a point in time before all that took place (which you can do, because your BACKUP_END record was written before you started your backup), you will have the row in B, but not the row in A. Data corruption. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com