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 1ogSdE-0000Zn-0F for pgsql-general@arkaria.postgresql.org; Thu, 06 Oct 2022 15:17:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ogSdC-0002zb-TF for pgsql-general@arkaria.postgresql.org; Thu, 06 Oct 2022 15:17:50 +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 1ogSdC-0002z8-HC for pgsql-general@lists.postgresql.org; Thu, 06 Oct 2022 15:17:50 +0000 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ogSdA-0003Y0-A9 for pgsql-general@postgresql.org; Thu, 06 Oct 2022 15:17:49 +0000 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-132555b7121so2560153fac.2 for ; Thu, 06 Oct 2022 08:17:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=BUab0VX1Obcybfw8Ghix0CTLbBaoyJZ1y67YAKZpKNY=; b=khaGDA4ySJgGLSG99fV07IDrk2fVI2IeozdLEk6qqfvNQ/PW7v0sopfE4p9sV+j1XC zakz6AMCp1gQN9QKTK4SxWrIquJ+t9LwHsEDNtZsW6pkTzaebZIX8jvxRPLHyirEFLsS Z11Yb3rGybvmZK7CgEi2fuPacRXb4MRkOjWJfdzybOsn9JPNyDzms1ZqQhKBJwAc0IW2 higlkM7q4gTEx8yXUoFZh5+MwjOGqvpqH60WXp+HXSXNWaUcjS9LsPB5UzaMva9tJYI2 3XP55wgBXTkT7Q3bOfNUVN0PVaW2mwSwq/MWneW2k06RiF+h3I5Mmc7hqHobvnLgGDsL a+hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BUab0VX1Obcybfw8Ghix0CTLbBaoyJZ1y67YAKZpKNY=; b=vf4mgHCxvfMcXwBBE74NdN0geAPlWse1oDjENKn20bpKGzdbb/cgV8z1Jie0S4XowV E80LL2HBLeMqUIxWG6DR8UG7WqsKeRS1kJLClsYaTdz+nvF5hPUYbG4z+bPIgL26Dlem quYpWMyVAl3k5v8Ngi3AxaC0CFJzcP0xDHdIJ9elCpV9c16ERMLT7JBCXDpMf2BBuMnV 1umb+5OOgkrLuFmICV+7yuDb9bFbi7pSf2SFVV4x4PiG3BmEKd6t3drKIj6dp0hsKstf ln2hi9r864MJhW6Lo6zeiXZSUbHPxwJf1Wkfw18jCLGWvPDW8WjEUtpV+Ra8oTKQRBFc 2I4w== X-Gm-Message-State: ACrzQf2FiMC9sej4MNhPx2OXqTgpkQaJT7HeVEbwGK4XF7Cr2Oi0d+m4 xmnABTMzc0nM30zYUA6TukW4QUEOdkE= X-Google-Smtp-Source: AMsMyM7/DyVOVSvAXsiBW4jGN9//XEy4Dys29Bjim2qR8KLQh3jDdTpgq1cG0kZUA7rqn8bQ4pcuEQ== X-Received: by 2002:a05:6870:831d:b0:10d:a96f:8bc with SMTP id p29-20020a056870831d00b0010da96f08bcmr5296823oae.143.1665069466933; Thu, 06 Oct 2022 08:17:46 -0700 (PDT) Received: from [192.168.88.10] (ip68-11-68-85.no.no.cox.net. [68.11.68.85]) by smtp.googlemail.com with ESMTPSA id i18-20020a9d6252000000b00659f659a5acsm5774521otk.27.2022.10.06.08.17.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Oct 2022 08:17:46 -0700 (PDT) Message-ID: <33eb3653-26f1-e6c1-dd16-c43ef93f7624@gmail.com> Date: Thu, 6 Oct 2022 10:17:44 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: pg_restore creates public schema? Content-Language: en-US To: pgsql-general References: <9a423047-24d9-1643-c91e-6c36508b987e@gmail.com> <2678272.1665067771@sss.pgh.pa.us> From: Ron In-Reply-To: <2678272.1665067771@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/6/22 09:49, Tom Lane wrote: > Ron writes: >> pg_dump 9.6.24 > You realize that that version's been out of support for a year? Yes, which is why I'm dumping from an EOL cluster, and restoring to a supported version. >> Why does pg_restore explicitly create "public" even though public is >> automatically created when the database is created? > We fixed that in v11 (see 5955d9341). Evidently the fix requires an > updated pg_dump more than pg_restore. Ah. > However, I believe that only happens with -c, so why are you using both -c and -C? Because the database might already exist on the target before doing the restore. -- Angular momentum makes the world go 'round.