Re: BUG #17598: EXTENSION can no longer create it's own schema! (Create Schema IF NOT EXISTS XXX)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: wolakk(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17598: EXTENSION can no longer create it's own schema! (Create Schema IF NOT EXISTS XXX)
Date: 2022-08-29 13:38:39
Message-ID: 3136392.1661780319@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Amit Kapila 2022-08-29 13:58:15 Re: BUG #17594: conditional hash indexes size (hash index ignore WHERE condition during CREATE INDEX?)
Previous Message Richard Guo 2022-08-29 09:45:50 Re: foreign join error "variable not found in subplan target list"