Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iORMS-0007vN-VT for pgsql-sql@arkaria.postgresql.org; Sat, 26 Oct 2019 19:04:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iORLR-0003dv-NF for pgsql-sql@arkaria.postgresql.org; Sat, 26 Oct 2019 19:03:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iORLR-0003dI-EC; Sat, 26 Oct 2019 19:03:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iORLO-00041J-AD; Sat, 26 Oct 2019 19:03:24 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x9QJ3Ide004298; Sat, 26 Oct 2019 15:03:18 -0400 From: Tom Lane To: Alex Williams cc: "pgsql-sql@postgresql.org" , pgsql-hackers@lists.postgresql.org Subject: Re: pg_dump compatibility level / use create view instead of create table/rule In-reply-to: <1095.1570720814@sss.pgh.pa.us> References: <30565.1570597261@sss.pgh.pa.us> <18dWrRFcmR7qHhsVTvYfGuRT8Tx5LijYQ72SeMWaya_0FiBkS5BFiYTa47R5WVTlADzXAqI85sZgkKPFVdJP2UWsUwJty3KuZ4eZvlVXO-I=@protonmail.com> <17815.1570661198@sss.pgh.pa.us> <-pa2tdKbasT5nWrYgCtvhKtMDyPIboaoG53ZSPb0MfCvzMUaVJDgQddN1ve-XLllFBKmQ8kGJ7InqBcYwq5CJY2DnLI4HVWTHyYx8wwBTtM=@protonmail.com> <1095.1570720814@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Thu, 10 Oct 2019 11:20:14 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4296.1572116598.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 26 Oct 2019 15:03:18 -0400 Message-ID: <4297.1572116598@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > Alex Williams writes: >> [ gripes about pg_dump printing REPLICA IDENTITY NOTHING for a view ] > This is fixed in v10 and up thanks to d8c05aff5. I was hesitant to > back-patch that at the time, but now that it's survived in the field > for a couple years, I think a good case could be made for doing so. > After a bit of looking around, the main argument I can find against > it is that emitting 'CREATE OR REPLACE VIEW' in a dropStmt will > break pg_restore versions preceding this commit: > Author: Tom Lane > Branch: master Release: REL_10_BR [ac888986f] 2016-11-17 14:59:13 -0500 > Branch: REL9_6_STABLE Release: REL9_6_2 [0eaa5118a] 2016-11-17 14:59:19 = -0500 > Branch: REL9_5_STABLE Release: REL9_5_6 [a7864037d] 2016-11-17 14:59:23 = -0500 > Branch: REL9_4_STABLE Release: REL9_4_11 [e69b532be] 2016-11-17 14:59:26= -0500 > Improve pg_dump/pg_restore --create --if-exists logic. After further digging, I remembered that we bumped the archive file version number in 3d2aed664 et al. to fix CVE-2018-1058. So current versions of pg_dump already emit archive files that will be rejected by pg_restore versions preceding the above fix, and so there should be no downside to emitting data that depends on it. I'll go see about backpatching d8c05aff5. regards, tom lane