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 1jovDe-0006ST-1S for pgsql-bugs@arkaria.postgresql.org; Fri, 26 Jun 2020 20:45:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jovDc-0007g4-SS for pgsql-bugs@arkaria.postgresql.org; Fri, 26 Jun 2020 20:45:04 +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 1jovDc-0007fx-MY for pgsql-bugs@lists.postgresql.org; Fri, 26 Jun 2020 20:45:04 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jovDZ-0003Ua-BH for pgsql-bugs@lists.postgresql.org; Fri, 26 Jun 2020 20:45:04 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 05QKiwoV029862; Fri, 26 Jun 2020 16:44:58 -0400 From: Tom Lane To: kravtsov.k@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16514: pg_dump v12 puts CREATE SCHEMA public statement into the backup file In-reply-to: <16514-3f214ab4550eb8fd@postgresql.org> References: <16514-3f214ab4550eb8fd@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Fri, 26 Jun 2020 18:40:59 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <29860.1593204298.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 26 Jun 2020 16:44:58 -0400 Message-ID: <29861.1593204298@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > I=E2=80=99m experiencing some weird behaviour of pg_dump: based on this = thread > https://www.postgresql.org/message-id/flat/20849.1541638465%40sss.pgh.pa= .us#744c293b37793dea0f6e60676c3f3210 > , starting from v11 pg_dump should not include CREATE SCHEMA public > statements to the dump. However, if I run pg_dump v12 with --schema publ= ic , > it still adds that line to the backup file, Our interpretation of that is that you've deliberately selected the schema, so it should be dumped. > which breaks the ability to > restore from it That's rather an overstatement no? You can just ignore the "already exists" error. regards, tom lane