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 1oSeyU-0006Ue-04 for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Aug 2022 13:38:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oSeyS-0005Yc-NL for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Aug 2022 13:38:44 +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 1oSeyS-0005YT-FJ for pgsql-bugs@lists.postgresql.org; Mon, 29 Aug 2022 13:38:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oSeyQ-0007IV-87 for pgsql-bugs@lists.postgresql.org; Mon, 29 Aug 2022 13:38:43 +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 27TDcdll3136393; Mon, 29 Aug 2022 09:38:39 -0400 From: Tom Lane To: wolakk@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17598: EXTENSION can no longer create it's own schema! (Create Schema IF NOT EXISTS XXX) In-reply-to: <17598-90d4e2f6057cbfec@postgresql.org> References: <17598-90d4e2f6057cbfec@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Sun, 28 Aug 2022 21:30:01 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3136391.1661780319.1@sss.pgh.pa.us> Date: Mon, 29 Aug 2022 09:38:39 -0400 Message-ID: <3136392.1661780319@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > Effectively if FEELS like the check for an schema/extension > "owning/belonging to" a schema/extension is failing. > In this case, the schema DOES NOT EXIST. And the create if not exists > FAILS! (Which feels like an edge case. This is an intentional change to close a security hole: it is unsafe for an extension script to use CREATE IF NOT EXISTS this way. (What if a hostile attacker created the schema? Now you are depending on a schema that the attacker has ownership privileges on.) Drop the IF NOT EXISTS clause, if you're expecting the extension to create the schema. regards, tom lane