Re: Assert failure due to "drop schema pg_temp_3 cascade" for temporary tables and \d+ is not showing any info after drooping temp table schema

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Mahendra Singh Thalor <mahi6run(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Assert failure due to "drop schema pg_temp_3 cascade" for temporary tables and \d+ is not showing any info after drooping temp table schema
Date: 2020-02-28 18:45:29
Message-ID: 4172.1582915529@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

I wrote:
> Also, I notice that isTempNamespaceInUse is already detecting the case
> where the namespace doesn't exist or isn't really a temp namespace.
> I wonder whether it'd be better to teach that to return an indicator about
> the namespace not being what you think it is. That would force us to look
> at its other callers to see if any of them have related bugs, which seems
> like a good thing to check --- and even if they don't, having to think
> about the point in future call sites might forestall new bugs.

After poking around, I see there aren't any other callers. But I think
that the cause of this bug is clearly failure to think carefully about
the different cases that isTempNamespaceInUse is recognizing, so that
the right way to fix it is more like the attached.

In the back branches, we could leave isTempNamespaceInUse() in place
but unused, just in case somebody is calling it. I kind of doubt that
anyone is, given the small usage in core, but maybe.

regards, tom lane

Attachment Content-Type Size
handle-missing-temp-namespace-better-1.patch text/x-diff 3.6 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Przemysław Szustak 2020-02-28 19:58:19 Re: BUG #16283: crash on create index segmentation fault
Previous Message Tomas Vondra 2020-02-28 18:11:35 Re: BUG #16283: crash on create index segmentation fault

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-02-28 18:59:49 Re: Allowing ALTER TYPE to change storage strategy
Previous Message Alvaro Herrera 2020-02-28 18:44:11 Re: HAVE_WORKING_LINK still needed?