Re: Temp schema drop leaves an inconsistent state behind

From: Marko Grujic <marko(dot)grujic(at)enterprisedb(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>, Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Manu <manuelreyesbravo(at)gmail(dot)com>, Marko Grujic <markoog(at)gmail(dot)com>
Subject: Re: Temp schema drop leaves an inconsistent state behind
Date: 2026-09-25 08:38:06
Message-ID: CAOvwyF2_8yOOuuZm9K9aRfB8LUbZC+_r97Np9ohwJArEFdYWag@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all, thanks for testing and commenting.

On Fri, Sep 25, 2026 at 3:48 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
> All these actions are doable only under a superuser, and there is an
> argument over the existing behavior being useful, for example to clean
> up orphaned objects post-crash-recovery.
>
> Superusers can do worse than that. For example issue a TRUNCATE on a
> few catalogs like pg_database, with set allow_system_table_mods =
> true. Now, that's much more interesting.

In that case the superuser is opting-in to something explicitly dangerous.

> My point being: we did not care back then for the reasons given back
> then related to superusers. Why should we care now? This discussion
> was feeling as a waste of precious resources back then; it still feels
> the same today.

I wasn't aware of those discussions, but unlike above, DROP SCHEMA
pg_temp_N looks innocent enough, yet it can break pg_dump (not to
mention the segfault) which seemed severe enough to me to warrant a fix.

Still if this is the consensus I don't mind leaving that as is.

That said I do think that the first part of the patch (0001, which fixes the
two identify-object functions) has merit on its own. If nothing else, then
at least to gracefully handle the existing behavior for temp schema drops.
I can post it separately with a regression test if there's interest.

Thanks,
Marko

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2026-09-25 08:41:38 Re: BUG: pg_class.relchecks overflow, making table undroppable
Previous Message Wei Sun 2026-09-25 08:37:42 Re: Severe performance degradation with concurrent updates due to excessive EvalPlanQual (EPQ) re‑evaluation