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 1lUKci-00056K-Fq for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Apr 2021 02:42:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lUKcg-0005Lv-Is for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Apr 2021 02:42:22 +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 1lUKcg-0005Lo-4n for pgsql-hackers@lists.postgresql.org; Thu, 08 Apr 2021 02:42:22 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lUKcZ-0008Me-Ng for pgsql-hackers@lists.postgresql.org; Thu, 08 Apr 2021 02:42:21 +0000 Received: by mail-pf1-x42d.google.com with SMTP id a85so274575pfa.0 for ; Wed, 07 Apr 2021 19:42:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=pYrrGSnAlSgb6Rd4r/5wNEYmNWuz5gQr9cUWw2CRBrg=; b=JvlTSCXY478OH7XrWnKgfIXfVHRn0zrT+uqaJp9frmf+8Rpqsjmr/Nsw+t1aZ07D0D sX9pq/RR23otd50F9/AhL4ad+fRY/fAW76mP3InHjraNon6TL0q2L0UBQvRNhVvSv2di xbsBIkqnlf6VHU1XQmMS6L5AbWKiuNpq684+w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=pYrrGSnAlSgb6Rd4r/5wNEYmNWuz5gQr9cUWw2CRBrg=; b=VeWOKkdEHkVnAfpBlbDHPK+CJ/8RaCKRHFSuK3Mpl5zdQn6jSmtVzy8CtzV/rPifE/ 6GMY/EHWTbkb1iMiPBAp/A+AoyHXjO/nr4F6wyqlEFLE0S7FmCJQD2vtI2k83oRko3CT PQOfRfzdTEGCV6y8NtNnwVfjTwymaTmUEXOfF1nzUVoZEcfADNMlZGsL+sjz0GIvDz// jOLKb2Knu22JlxDVfb9QMY6IeZDRDTGgo/8DyPvITIv0XBqrzj2K9tgkEjqTGurXHz64 oihuuzPCT8ciN7B1JWwO1ZB+zdkWkfTFL8wEotVyWlYuV1HZYP4ioN85IzKqFQI5JEHB TVeQ== X-Gm-Message-State: AOAM530EZ6bJalYv1iGTyS/fsveT88SVfkrBK/yjjYJ6OPoJ7/A7yw4i regQDgkZwpStsRKDeMoY74AjDg== X-Google-Smtp-Source: ABdhPJxvej/G2Jmbu2pCggb5IdqSH65yzW9Pmt40rinh9DHhTG7TkgYGsrm314LhchJkGfrLgaSDVw== X-Received: by 2002:a62:5e05:0:b029:20b:241e:4e18 with SMTP id s5-20020a625e050000b029020b241e4e18mr5529094pfb.1.1617849734606; Wed, 07 Apr 2021 19:42:14 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::46]) by smtp.gmail.com with ESMTPSA id n73sm23698132pfd.196.2021.04.07.19.42.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Apr 2021 19:42:13 -0700 (PDT) Date: Wed, 7 Apr 2021 19:42:11 -0700 From: Noah Misch To: Michael Paquier Cc: Guillaume Lelarge , Julien Rouhaud , Tom Lane , Daniel Gustafsson , PostgreSQL Hackers Subject: Re: Extensions not dumped when --schema is used Message-ID: <20210408024211.GA893043@rfd.leadboat.com> References: <20210315102155.qgp32wo6tcuu6w4l@nol> <20210404220802.GA728316@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210404220802.GA728316@rfd.leadboat.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Apr 04, 2021 at 03:08:02PM -0700, Noah Misch wrote: > On Wed, Mar 31, 2021 at 09:37:44AM +0900, Michael Paquier wrote: > > On Tue, Mar 30, 2021 at 12:02:45PM +0900, Michael Paquier wrote: > > > Okay. So I have looked at that stuff in details, and after fixing > > > all the issues reported upthread in the code, docs and tests I am > > > finishing with the attached. The tests have been moved out of > > > src/bin/pg_dump/ to src/test/modules/test_pg_dump/, and include both > > > positive and negative tests (used the trick with plpgsql for the > > > latter to avoid the dump of the extension test_pg_dump or any data > > > related to it). > > > > I have double-checked this stuff this morning, and did not notice any > > issues. So, applied. > > I noticed the patch's behavior for relations that are members of non-dumped > extensions and are also registered using pg_extension_config_dump(). It > depends on the schema: > > - If extschema='public', "pg_dump -e plpgsql" makes no mention of the > relations. > - If extschema='public', "pg_dump -e plpgsql --schema=public" includes > commands to dump the relation data. This surprised me. (The > --schema=public argument causes selectDumpableNamespace() to set > nsinfo->dobj.dump=DUMP_COMPONENT_ALL instead of DUMP_COMPONENT_ACL.) > - If extschema is not any sort of built-in schema, "pg_dump -e plpgsql" > includes commands to dump the relation data. This surprised me. > > I'm attaching a test case patch that demonstrates this. Is this behavior > intentional? I think this is a bug in $SUBJECT.