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 1pOiEU-0003vg-RS for pgsql-bugs@arkaria.postgresql.org; Sun, 05 Feb 2023 16:51:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pOiET-0004YX-FU for pgsql-bugs@arkaria.postgresql.org; Sun, 05 Feb 2023 16:51:13 +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 1pOhK6-0004zu-NB for pgsql-bugs@lists.postgresql.org; Sun, 05 Feb 2023 15:52:58 +0000 Received: from mx08-001fd203.pphosted.com ([185.183.31.150]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pOhK3-0005QH-8s for pgsql-bugs@lists.postgresql.org; Sun, 05 Feb 2023 15:52:57 +0000 Received: from pps.filterd (m0247222.ppops.net [127.0.0.1]) by mx07-001fd203.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 315FMSFO013425; Sun, 5 Feb 2023 16:52:51 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emeria.eu; h=from : to : subject : date : message-id : references : in-reply-to : content-type : mime-version; s=s2022; bh=m876gzg+96jJYIAJmvgE7FwySHamF4DFnv2pZjmdkGw=; b=Bo7r+DItJdjRd1zYxxJWTYuD5a57ui2vxHZUK+ZINEAKgn3g1kAWb34b6XZTGzcrkCiK GrXwSpSZstxMV9Bbgzd/JHmHpV1xWuypOMolEm506+zAwpaYy/fleLOnp1nLFUSh9g0v l6r8Lg/BNfBW3utaTnl8gZCZktRxV9BSq9mdi/EpowzidDa2QQCrRkURGbh0PgX1NcaD pepMOU807AV6wxm/Ssw0QyKkQAue1y6wFVm+FjzaFwxEYvovPeEWmKc3IRcFqpAlZBOv TDzmgt8RJKFScRT+4uKG384D8VW7TxWy45/4Rc6QA1Ac9wkrdI5BDH7ItUNj34TGIlZ3 ww== Received: from eur01-he1-obe.outbound.protection.outlook.com (mail-he1eur01lp2055.outbound.protection.outlook.com [104.47.0.55]) by mx07-001fd203.pphosted.com (PPS) with ESMTPS id 3nhf1t18ne-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 05 Feb 2023 16:52:51 +0100 Received: from PR0P264MB0492.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:b::15) by PR0P264MB1978.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:16d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34; Sun, 5 Feb 2023 15:52:49 +0000 Received: from PR0P264MB0492.FRAP264.PROD.OUTLOOK.COM ([fe80::c306:baa1:d10d:d7e7]) by PR0P264MB0492.FRAP264.PROD.OUTLOOK.COM ([fe80::c306:baa1:d10d:d7e7%6]) with mapi id 15.20.6064.032; Sun, 5 Feb 2023 15:52:49 +0000 From: ROCHER Julien To: Julien Rouhaud , "pgsql-bugs@lists.postgresql.org" Subject: Re: TR: Issue: --exclude-schema flag not working with pgrestore Thread-Topic: TR: Issue: --exclude-schema flag not working with pgrestore Thread-Index: AQHZJWIVBigwSmRowUq63KxdAIkA+a6Y7U8AgAAJZACAAA4XB4AAMWyAgAANjFmAJ2Q/uw== Date: Sun, 5 Feb 2023 15:52:49 +0000 Message-ID: References: <20230111094026.6jajog43mb42rwvv@jrouhaud> <20230111132745.ixeqtykgvcpfoxhc@jrouhaud> In-Reply-To: Accept-Language: fr-FR, en-US Content-Language: fr-FR X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PR0P264MB0492:EE_|PR0P264MB1978:EE_ x-ms-office365-filtering-correlation-id: a49b6653-ac4b-4469-4245-08db07910827 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ZZoyYphYddWuFbNsndPf+1eh7Qn5UTUCDxS8bXb9GRoL+WQm2BIZ6yi0EY9P+AsIq5CfbLL0HGeSmRdQU6GiO4Zf+NQoQTvlqpWU3AjQGt/BHH1ViJ3QKdK11L0s0iqRUxU6IbcNlmEZpfcy6vaIlxWAdhS5NRg4PulscQkMRxPafaM2yBFAeFhZE5rRCs549E2M06FtKQOHJk1hBTxeIKFJgWpf59QtaZJ7QNHiQ3kysUUci7HpaAPvFJvTQBkJ+DnDEx1NDBGk2hDQ0upV9XDzBJsTcXVVKSccKS1VDAmJ4ufikJeOUr/oUUFBfCvMQ3+a31TBNrht8A56NJVO/ZIwzeVxwydfusLGGyAYY9saPcKC0cm3ac/56bi8SB544uStoSLys1q6LKm7RB8lb9NKhZLk/in8fR68Ss0h0HtQaR4tt9JehHJMxb2bXUW3bS+QChBZc8/+U0vOhxJC2FPDPjXCkdk1jhE1gM/Ohwt7rTtOXZJ0t+hKWgi720jeJ5FMdUQWLizf9FRpJYznjJbW2YpcdOEnMwwUa5B/lTVokzgglHeeMAam5yT5Frh/Yf9kBbVOFODfv2SlyYIL/dNpEIgvY6gq0hiJ46oA7Jlw63JA0xqMzPBI9VUqg4HiN/yTHZbdpjWK24++eRn2jYaRdCld327QfFIJLHM+piAO7BTmom6qvfzVXJj84Jh0kUImWf/Gdip8lzR3bPRWPg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PR0P264MB0492.FRAP264.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230025)(396003)(346002)(136003)(366004)(39850400004)(376002)(451199018)(66574015)(110136005)(316002)(33656002)(86362001)(55016003)(38100700002)(38070700005)(6506007)(83380400001)(26005)(9686003)(186003)(122000001)(8936002)(7696005)(5660300002)(478600001)(71200400001)(52536014)(41300700001)(2906002)(76116006)(66946007)(66476007)(66446008)(64756008)(8676002)(66556008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?/KdLxvEDSBUacwETdAL7suZ+pfuvXeB4ZO/WS0U6Nxbw4norxQUxFe6W?= =?Windows-1252?Q?s/S36A3Fl8EkMxurPRxm6fSFUZ+1c/M1Psu/PNGneKgCiLGKWvHLJA4X?= =?Windows-1252?Q?A+Zv1zypSpQvjs/zvML7udSwM8tYZpux45ze42bvcK0V1IQJxDmz6LM+?= =?Windows-1252?Q?3wdKyMmUT2R7Qplv4LqAlXFq4neDSYouBVn1o+CNCWt5GleJkgKrFU93?= =?Windows-1252?Q?ZJUOMibnXV1ZYbMshkL25szaD7z0IskgEUOShI7LxfRY/AzHhkAUVGFP?= =?Windows-1252?Q?q7EeVdHMPWGv5Dwl3q+HPH9PY/umvvE3UHBJkuI+Yxvq1ozSr58Zf4EZ?= =?Windows-1252?Q?M8vwUkMDudpCFAuueImb/z7L7rzvU/4Tpx0fuhaoZSaMJx3D2el9hyQs?= =?Windows-1252?Q?9kd6MiBUBZfo6YbpSwrBRC9Cs1i1tab+jS45IihbMmo2hvDYOOxixdMe?= =?Windows-1252?Q?ca6+GeRiDJKH1vje1cXhkH+lp2avKmK92boLxrdShWVwLETDqnpNjaEo?= =?Windows-1252?Q?X12ILQJO8pitZQy/uRpVwN46C+Juce554EuRb1yvL530j788r0q/f3Cy?= =?Windows-1252?Q?huHKe503S0DCSCUoVHOqCmCcd/JdiPa3KXk5yw1NVuOFU15cGJiAihwG?= =?Windows-1252?Q?2Zvqff8gqHCorct1/sW+XgM2TKsMo0f7+1q83FGSZp1HB4j3RMai7UGu?= =?Windows-1252?Q?CPLhXV8wezP2tA4/JLrqDSdvdbbNmEcy6tUvkA2uYOuHIWeTbn1XBZ05?= =?Windows-1252?Q?ExTvoDiZvWgl1zeqCYZRyio0tOGDnOcJaZgUjqMWWgCmFrPnQat5jXcx?= =?Windows-1252?Q?WRrZ1THK8e6sK2exSckG3+1+S26mZcvl2ezVOtWkJPDj8TV5PbgJtwNS?= =?Windows-1252?Q?UOc/OG+/9r4jWojrAn97Jk3smm+w/5qPa4I7EbCDwTJEblou1H9hQX4P?= =?Windows-1252?Q?mzne/+BMrSI0djlKgW4qbvYH7fe2mCgDbRJIfnGhxk4C4T8eB8mjeELM?= =?Windows-1252?Q?0oWRPnq2p13cl2uykuh1FdgU442jlXd78214VuqpRyjQksV+FA0mrYLI?= =?Windows-1252?Q?k0jaaz6uuWweh4wRzxbJuAiM1ZQLYrORHXi2vcsVO5Ix9zh5vfCmsP57?= =?Windows-1252?Q?ScNK3Kg4IEl+jI28GFvaceTWEAF2InzdIJV7VZ9u6qgLwGDLxyXPs4xM?= =?Windows-1252?Q?4AiXgPmss2q6OhV9rX4cVKdsnxmkg37EV3QKNc+h8FDVFVwZ5FOIKxSj?= =?Windows-1252?Q?K6tTG+6JU1W7pv3fg8AQofcTdvdu135nfkU/lkzqdjhahB1eaiFo7G4K?= =?Windows-1252?Q?cxJ4dCFSaNjAO3mNdJ40wQrobdicwD6yVWecjCTRGxiAHNqNw/Yt/kei?= =?Windows-1252?Q?CF9gvKOEs/ELC6JbFelxdNKCQ59Gpztv32FxOPtDM4MNpBJeVsxWmkn3?= =?Windows-1252?Q?0mZXXCSitXpmMgMeeoYvJyFGqNeesRjuA2GPoF/vxR96ZYBgbke+iRDe?= =?Windows-1252?Q?gcrRPbYJ1KdPj+blQfKWkOrIoxDr8RLvwbMILPousar7TNl09hm7+2QB?= =?Windows-1252?Q?z+nVv6dNZtxpBbtS+ZmvNnZSt+UUi+1B344Wr7Ac2G91ti4a0w2gpOpC?= =?Windows-1252?Q?R3K+0HM/Th10t1w578uHadt2O1TDrjYImto6oDbFIVf7NVHmN0jpSnLX?= =?Windows-1252?Q?ahXYcpqC/RHBsASXw/LMKoKIDeWyC04WZ0way7U70dlLFZkADQd+5g?= =?Windows-1252?Q?=3D=3D?= Content-Type: multipart/alternative; boundary="_000_PR0P264MB04927B42E2CDD12982180587EDD59PR0P264MB0492FRAP_" MIME-Version: 1.0 X-OriginatorOrg: emeria.eu X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PR0P264MB0492.FRAP264.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: a49b6653-ac4b-4469-4245-08db07910827 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Feb 2023 15:52:49.1187 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b2300aeb-a6b6-46db-a8ba-f119911d7dce X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cQADoCnQqZ3lf6kjTyUh3/wVDXlvDipFGgJjBvR3N2xtGm8o4q3QL/0GxMVpeLFzO2KdmjHjfesIkl6VBFSW3w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR0P264MB1978 X-Proofpoint-ORIG-GUID: n3Yjuil75JhD5Uxyq4vce18G9C3rICkb X-Proofpoint-GUID: n3Yjuil75JhD5Uxyq4vce18G9C3rICkb List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_PR0P264MB04927B42E2CDD12982180587EDD59PR0P264MB0492FRAP_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi again, I was wondering though, do you know why it is different from pgdump -N beh= avior (Do not dump any schemas matching pattern) ? Julien ROCHER D=E9veloppeur Team Data - Migration Emeria Technologies 76-78 Avenue des Champs Elys=E9es =96 75008 Paris 06 17 17 60 64 julien.rocher@emeria.eu De : ROCHER Julien Date : mercredi, 11 janvier 2023 =E0 15:16 =C0 : Julien Rouhaud Objet : Re: TR: Issue: --exclude-schema flag not working with pgrestore Ok thank you for you feedback Julien ROCHER D=E9veloppeur Team Data - Migration Emeria Technologies 76-78 Avenue des Champs Elys=E9es =96 75008 Paris 06 17 17 60 64 julien.rocher@emeria.eu De : Julien Rouhaud Date : mercredi, 11 janvier 2023 =E0 14:27 =C0 : ROCHER Julien Objet : Re: TR: Issue: --exclude-schema flag not working with pgrestore On Wed, Jan 11, 2023 at 10:43:10AM +0000, ROCHER Julien wrote: > > Indeed this partially solved the problem. However, although it doesn=92t = try to > restore the =93country.number" table, it still tries to create the =93cou= ntry=94 > schema. Do you think it=92s wanted ? Yes that's the wanted behavior. Per documentation: -N schema / --exclude-schema=3Dschema Do not restore objects that are in the named schema So it filters objects **in** the schema but not the schema itself. If you want to also ignore the CREATE SCHEMA order, or some fancier behavio= r, you need to use the --list / --use-list and cherry pick the parts you want = to keep or discard. --_000_PR0P264MB04927B42E2CDD12982180587EDD59PR0P264MB0492FRAP_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable

Hi again,

 

I was wondering though, do you know why it is differ= ent from pgdump  -N behavior (Do not dump any schemas matching pattern= ) ?

 

 

Julien ROCHER

D=E9veloppeur Team Data - Migration

 

Emeria Technologies

76-78 Avenue des Champs Elys=E9es =96 75008 Paris <= span style=3D"font-size:11.0pt">

06 17 17 60 64

julien.rocher@emeria.eu

 

 

De : ROCHER Julien <j= ulien.rocher@emeria.eu>
Date : mercredi, 11 janvier 2023 =E0 15:16
=C0 : Julien Rouhaud <rjuju123@gmail.com>
Objet : Re: TR: Issue: --exclude-schema flag not working with p= grestore

Ok thank you for you feedback

 

Julien ROCHER

D=E9veloppeur Team Data - Migration=

 

Emeria Technologies

76-78 Avenue des Champs Elys=E9es =96 75008 Paris <= o:p>

06 17 17 60 64

julien.rocher@emeria.eu

 

 

 

 

 

 

 

 

De : Julien Rouhaud <= rjuju123@gmail.com>
Date : mercredi, 11 janvier 2023 =E0 14:27
=C0 : ROCHER Julien <julien.rocher@emeria.eu>
Objet : Re: TR: Issue: --exclude-schema flag not working with p= grestore

On Wed, Jan 11, 202= 3 at 10:43:10AM +0000, ROCHER Julien wrote:
>
> Indeed this partially solved the problem. However, although it doesn= =92t try to
> restore the =93country.number" table, it still tries to create th= e =93country=94
> schema. Do you think it=92s wanted ?

Yes that's the wanted behavior.  Per documentation:

 -N schema / --exclude-schema=3Dschema
    Do not restore objects that are in the named schema

So it filters objects **in** the schema but not the schema itself.

If you want to also ignore the CREATE SCHEMA order, or some fancier behavio= r,
you need to use the --list / --use-list and cherry pick the parts you want = to
keep or discard.

--_000_PR0P264MB04927B42E2CDD12982180587EDD59PR0P264MB0492FRAP_--