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 1jn29y-0006Oj-3y for pgsql-general@arkaria.postgresql.org; Sun, 21 Jun 2020 15:45:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jn29x-00038L-13 for pgsql-general@arkaria.postgresql.org; Sun, 21 Jun 2020 15:45:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jn29w-000381-OG for pgsql-general@lists.postgresql.org; Sun, 21 Jun 2020 15:45:28 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jn29t-0005BT-E3 for pgsql-general@lists.postgresql.org; Sun, 21 Jun 2020 15:45:27 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id A475932B7; Sun, 21 Jun 2020 17:45:20 +0200 (CEST) Date: Sun, 21 Jun 2020 17:45:20 +0200 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: The backup API and general purpose backup software Message-ID: <20200621154520.GC21591@hjp.at> References: <20200621132843.GB21591@hjp.at> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="oJ71EGRlYNjSvfq7" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --oJ71EGRlYNjSvfq7 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2020-06-21 10:32:16 -0500, Ron wrote: > On 6/21/20 8:28 AM, Peter J. Holzer wrote: > > To make a full backup with the "new" (non-exclusive) API, a software > > must do the following > >=20 > > 1. open a connection to the database > >=20 > > 2. invoke pg_start_backup('label', false, false) in the connection from > > step 1. > >=20 > > 3. copy the contents of the data directory to the backup medium > >=20 > > 4. invoke pg_stop_backup(false, true) in the connection from step 1. > >=20 > > 5. copy the result from the previous step to the backup medium. >=20 > I don't understand that last step "5. copy the result from the previous s= tep > to the backup medium."=C2=A0 It seems to be a duplication of "3. copy the > contents of the data directory to the backup medium". Step three copies all the files from the data directory. However, there is an additional piece of information you you need to recover the database, and that is only returned by the call to pg_stop_backup: postgres=3D# select * from pg_stop_backup(false, true); =E2=95=94=E2=95=90[ RECORD 1 ]=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=97 =E2=95=91 lsn =E2=94=82 A9/2F000130 = =E2=95=91 =E2=95=91 labelfile =E2=94=82 START WAL LOCATION: A9/2F000028 (file 000000= 01000000A90000002F)=E2=86=B5=E2=95=91 =E2=95=91 =E2=94=82 CHECKPOINT LOCATION: A9/2F000060 = =E2=86=B5=E2=95=91 =E2=95=91 =E2=94=82 BACKUP METHOD: streamed = =E2=86=B5=E2=95=91 =E2=95=91 =E2=94=82 BACKUP FROM: master = =E2=86=B5=E2=95=91 =E2=95=91 =E2=94=82 START TIME: 2020-06-21 17:36:30 CEST = =E2=86=B5=E2=95=91 =E2=95=91 =E2=94=82 LABEL: backup # 1234 = =E2=86=B5=E2=95=91 =E2=95=91 =E2=94=82 START TIMELINE: 1 = =E2=86=B5=E2=95=91 =E2=95=91 =E2=94=82 = =E2=95=91 =E2=95=91 spcmapfile =E2=94=82 17522 /home/postgres = =E2=86=B5=E2=95=91 =E2=95=91 =E2=94=82 = =E2=95=91 =E2=95=9A=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=A7=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=9D Without this information the backup is useless, so it must be backed up, too. Obviously you can do that only after you got it. hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --oJ71EGRlYNjSvfq7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAl7vgIwACgkQ8g5IURL+ KF3JHBAAivZCBOLMVK3iJ8GJwbTC+Mh4Etti+vqdeVIfHFF+8WHI/BvMmYwzTPJQ VXoqzs4ONIX4ctnS6nX5V2rw+qsJiNZLBQ2HqDCCuNJSlUfH4XAmUlVXrEngmcKW 4hrsDvywDBSoVdomm75lmgarhFBbJUXEsIDU+jlOCCBB0GlkHV/oPcdHqQlDQDi6 Fqb9xXVObR4ZTWWfXQzphrsDY9v0gjYuvQ9Sa3bZT57/ovOsmmvERsJUvL73SlnV v4qc1EamuI5V0F39pTMlLz5/aJC089hH4vAoFpKenqslp2RZwKXI6qwBPK0yX6cf thHzr7dXBHUPG9I6mHGk2dD/HvsSwuj8BfJ8lyrEFVSeqarRUk8cIwpHd0LwPCg3 xs8zEXXIpOTGPjhh8bwF9lFQJ/UKCquoLBcSUGZquiT//ZxuzCM7zC4OplxaKD3M pktemzJtd/9FPFqkjLvaRZTIvwcqsHJq9+c8UupBgIG6NokoUjrLQIUs1mGgnVZm lKTD/ZNdjOyj/aYEohoJovmHsbBPoDCBHEm6e/a2qwa5iTwpKZQX648y8Tn80V3f ivhFL1WPTFbd2h3lTkStvURJsL90eUfbO4nMYRcrFisoyQa7XNW2Fh1xlNy98SQY 2GIvwNkgfJYbg/tGSE4ze2JlwRlfXC9j+fMQlJNkFm8mu7287A4= =VpER -----END PGP SIGNATURE----- --oJ71EGRlYNjSvfq7--