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 1ogRo0-0006Sk-0y for pgsql-general@arkaria.postgresql.org; Thu, 06 Oct 2022 14:24:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ogRny-00010x-T3 for pgsql-general@arkaria.postgresql.org; Thu, 06 Oct 2022 14:24:54 +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 1ogRny-00010n-H7 for pgsql-general@lists.postgresql.org; Thu, 06 Oct 2022 14:24:54 +0000 Received: from mail-oa1-x2c.google.com ([2001:4860:4864:20::2c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ogRnm-00039h-R7 for pgsql-general@postgresql.org; Thu, 06 Oct 2022 14:24:53 +0000 Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-1324e7a1284so2330909fac.10 for ; Thu, 06 Oct 2022 07:24:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:subject:from:content-language:to :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=STj+ubmXzJc4XPEhQAukXQkfcNcIY9F6TxhGXqCFL0Q=; b=fZXVXqchaL6iZf4gdjAEMog4byZXcMfxjH0mu+QBPxdbGYz3AHlufp10uqg00vVFj9 2tMAC3UNTyD0FzxKXJRsyeRm4kvqJCx3Huyd8FlNMi0CJ9s3De5Iruu6Bx7q2gn7aEDr GnBK1e/UD1F8gQUgQbVnAgdFahC7I2YbpYAGp4JfPcrrUPknSvkZEgZzBfPRdUan2NUr Ma+deWT0TPfyE1z/HM0NlJp+8/18IWLZb3jm8O+m+wZiSrKqNGJEQYW1nL5i+6JMpLxC 5DcXHavbK0srd8lh5oO4GAurUglao1SeaqqzIFjeOo5CtX+jyKPEpO1GIXCFHxL+PB0p gC6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:subject:from:content-language:to :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=STj+ubmXzJc4XPEhQAukXQkfcNcIY9F6TxhGXqCFL0Q=; b=zks7WHbB19AFoOUCnYfHyBM3rO4JOd4XtR8uBvGlPRMQLxpXGZSdVoF3T85VzJvhvU OkmxKLzcadrYCjNbm6A6vlZkLDfnFhe1cfBeE6sh4fRaI2OconL6lvpyFv4XaulSk2aO 3kPgmJemKdyFzdZeKxYtpF1tBahg7PtHpgWtS+T+EBHOJHGS0l/VLIJGH2/Rw/ISjtMF dMgAHkWODLwiGstIdJASrOQYpZRC//dR0FYYndlfXX6N0brHKzjBrGYHUNV0pUTDbe+k hZ4ileJf2J6UMBtW+5YvZHzWv5dIOeuCWvzSMJzl0cMIavs4od9E2e/ManLAjIB+i79m 8vqg== X-Gm-Message-State: ACrzQf0ctZbwtMigTdc5dI4DWyn6oguzv9lJEr0UCvIxDMdBv4Gsl0cD MUlPZhftQOy9k+dcv3+eQkkfUSJh9x4= X-Google-Smtp-Source: AMsMyM53UhkheyWT7xfD6qmbkn290e/d6XdfpyPH7ndTGaLeYfUbgriUE3kfRY8quQoiFX7ohkZbWA== X-Received: by 2002:a05:6870:b388:b0:133:297f:c30 with SMTP id w8-20020a056870b38800b00133297f0c30mr687926oap.115.1665066280589; Thu, 06 Oct 2022 07:24:40 -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 y4-20020a4acb84000000b0047f94375092sm581111ooq.40.2022.10.06.07.24.39 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Oct 2022 07:24:39 -0700 (PDT) Message-ID: <9a423047-24d9-1643-c91e-6c36508b987e@gmail.com> Date: Thu, 6 Oct 2022 09:24:39 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 To: pgsql-general Content-Language: en-US From: Ron Subject: pg_restore creates public schema? Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk pg_dump 9.6.24 pg_restore 13.8 Why does pg_restore explicitly create "public" even though public is automatically created when the database is created? I noticed that when using "--exit-on-error".  It's disappointing, because I had to remove that option, which caused the restore to ignore other, actually important errors.) $ cd /var/lib/pgsql/backups/dumps/2022-10-04 $ pg_restore -vcC --if-exists --jobs=12 -Fd -d postgres CDSLBXW pg_restore: connecting to database for restore pg_restore: dropping DATABASE CDSLBXW pg_restore: processing item 10813 ENCODING ENCODING pg_restore: processing item 10814 STDSTRINGS STDSTRINGS pg_restore: processing item 10815 SEARCHPATH SEARCHPATH pg_restore: processing item 10816 DATABASE CDSLBXW pg_restore: creating DATABASE "CDSLBXW" pg_restore: connecting to new database "CDSLBXW" pg_restore: processing item 14 SCHEMA cds pg_restore: creating SCHEMA "cds" pg_restore: processing item 18 SCHEMA dba pg_restore: creating SCHEMA "dba" pg_restore: processing item 10 SCHEMA public pg_restore: creating SCHEMA "public" pg_restore: while PROCESSING TOC: pg_restore: from TOC entry 10; 2615 2200 SCHEMA public postgres pg_restore: error: could not execute query: ERROR:  schema "public" already exists Command was: CREATE SCHEMA public; -- Angular momentum makes the world go 'round.