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 1pIWzO-0006YV-CO for pgsql-bugs@arkaria.postgresql.org; Thu, 19 Jan 2023 15:38:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pIWzM-0003Yu-R2 for pgsql-bugs@arkaria.postgresql.org; Thu, 19 Jan 2023 15:38:04 +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 1pIWzM-0003Yl-Im for pgsql-bugs@lists.postgresql.org; Thu, 19 Jan 2023 15:38:04 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pIWzK-00068Q-Gw for pgsql-bugs@lists.postgresql.org; Thu, 19 Jan 2023 15:38:04 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 30JFc0L14062762; Thu, 19 Jan 2023 10:38:00 -0500 From: Tom Lane To: David Rowley cc: justin@tonic.ai, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17753: pg_dump --if-exists bug In-reply-to: References: <17753-9c8773631747ee1c@postgresql.org> Comments: In-reply-to David Rowley message dated "Thu, 19 Jan 2023 22:50:20 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4062760.1674142680.1@sss.pgh.pa.us> Date: Thu, 19 Jan 2023 10:38:00 -0500 Message-ID: <4062761.1674142680@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > On Thu, 19 Jan 2023 at 22:31, PG Bug reporting form > wrote: >> Running pg_dump with the options "--section=pre-data --no-owner >> --no-privileges --no-subscriptions --no-publications --clean --if-exists >> --file=/Users/ju5tinz/Dev/pg_pass_test/pre_data.sql" prints the warning: >> pg_dump: warning: could not find where to insert IF EXISTS in statement "-- >> *not* dropping schema, since initdb creates it >> " > Are you able to share the full warning message including the statement? Noting that that string is only associated with the public schema, I tried dumping a DB in which the public schema had been dropped --- no dice --- and then recreated --- and then it reproduces! Apparently, a schema that's named "public" but isn't the original one is confusing something somewhere, but I'm not immediately seeing where. regards, tom lane