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 1pyvS4-0007Zt-HO for pgsql-docs@arkaria.postgresql.org; Tue, 16 May 2023 14:14:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pyvS2-0003bT-Ir for pgsql-docs@arkaria.postgresql.org; Tue, 16 May 2023 14:14:54 +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 1pyvS1-0003bK-Vu for pgsql-docs@lists.postgresql.org; Tue, 16 May 2023 14:14:54 +0000 Received: from tamriel.snowman.net ([70.109.60.50]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pyvRz-0008Pv-3w for pgsql-docs@lists.postgresql.org; Tue, 16 May 2023 14:14:52 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 32DA15F7B7; Tue, 16 May 2023 10:14:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=snowman.net; s=dkim; t=1684246485; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rMEMxCD6l5iDRokeEHCp00FkhU0l/bKogZgKbn11/4g=; b=QUJ6WoTvRhrLesji78A59hS3FVAv2DOzM06UfoJ8rQl2ntfNQ+OFwQoRIdbjpuW17Dz0MH io/AN7t7WWfJ+cyLm9iczQ0+DhRKcBOBvAtU4JCwzZ6v+K+ni0FXweE6Gh22m4Fl1cMjC3 uh2OZ1alPf3Nr2Qb+TtdTSoAR8m9lIs= Date: Tue, 16 May 2023 10:14:45 -0400 From: Stephen Frost To: sonicmonkey@gmail.com, pgsql-docs@lists.postgresql.org Subject: Re: pg_basebackup application does not dump all database objects Message-ID: References: <168423776321.714.17805484409630880522@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="CmoJO+EdxuRJN0Xg" Content-Disposition: inline In-Reply-To: <168423776321.714.17805484409630880522@wrigleys.postgresql.org> User-Agent: Mutt/2.1.4 (2021-12-11) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --CmoJO+EdxuRJN0Xg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * PG Doc comments form (noreply@postgresql.org) wrote: > It would be good to point out on the pg_basebackup documentation that it > behaves differently from >=20 > SELECT * FROM pg_start_backup('label', true, false); > cp -a xxx yyy > SELECT * FROM pg_stop_backup(false, true); =2E.. that's not actually a backup. Doing the above, you won't get a backup_label and unless you take other steps, PG will end up thinking it's doing crash recovery. That's not good and can lead to corruption. If you're going to consider taking a low-level backup you should read the documentation here: https://www.postgresql.org/docs/15/continuous-archiving.html#BACKUP-LOWLEVE= L-BASE-BACKUP Which specifically goes into the question about replication slots. > method. One thing discovered was that the latter retains replication slot > information on the clone while pg_basebackup discards all replication slot > information. Not sure if it is a feature or a bug (replication slots > retention is a good thing). Our documentation points out a number of reasons why it's not, I'd suggest you read the above. > And perhaps there are more such subtle differences? Not sure that there's really that many other differences between pg_basebackup and a properly implemented low-level backup. You certainly have to do a lot more than what you have above to have a properly implemented low-level backup though. Thanks, Stephen --CmoJO+EdxuRJN0Xg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEwf6gbxKhD863zrx/7WyKOINHZFUFAmRjj9IACgkQ7WyKOINH ZFU96w//XSoKRFKQJmoM+bCgQsSaSVsn2y/frUMTA3yh0rfRQqDavW4mH8J9I5Ch 7h2C+whYHDlLY+mAoHZruTluOXGL//dTjVlm66Z5IkN7AHu8clAZjJGm+xtk5rp6 cQY24WQgLjlJwb09EwsTXuZicEtozN5mNaWe1kG6sjRyY2v/b04QtI5RqlzreGKt O8Q4fXrYgju/w911afR8zQyyz98RwK232+/isUMd2wQDstPPAcsLMtQKOR9xe9Ym VxepykG7ooJEY2+MB+G0eo6c//BD9IuvtZzjpJfNuQmMuhPbnszW+by3sPu1PwT/ o3Tbdr5Tja6JPTq/kmzc80+gy8XKo+YS30t7CJd7K9TJ1TeutCPihdclt1iMN73F N2WR2LJcAHR02EcR+zNf3GANjEDvemFWYdMeYABTrxG+pQCK1nRH8HzkqbZiwMxE iamU97U2ZnfKlJv5fqfr5RmU1H25A9ABx4AIfqQXvtLKrdjc0SK3ifRTA2ZUGZUq MOyeSVOPxVoZQiOczD2e+4Ydcp/9dmzC3oJkMCDD1ATYn2oXD5PvQ0WNQZ0N7+yl MRMB05INPeLwZrjADmfVUp6LxNpgp1K7xFDVr8IukhqTIP3iBRi2mYRQQ7aahn+a pU4y6q4q3P+Tm/DQEBbTYWtxd6KodXYaNZQFi397TwDgyEkKR9w= =khZq -----END PGP SIGNATURE----- --CmoJO+EdxuRJN0Xg--