Re: Skip temporary table schema name from explain-verbose output. - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Skip temporary table schema name from explain-verbose output.
Date
Msg-id CANbhV-GSrJBoTwVSnJLG59P4V=htMEpjD1ghot49uQ9dtnfP6g@mail.gmail.com
Whole thread Raw
In response to Re: Skip temporary table schema name from explain-verbose output.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, 26 Jul 2021 at 17:49, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> I wrote:
> > Simon Riggs <simon.riggs@enterprisedb.com> writes:
> >> Surely we need a test to exercise this works? Otherwise ready...
>
> > There are lots of places in the core regression tests where we'd have
> > used a temp table, except that we needed to do EXPLAIN and the results
> > would've been unstable, so we used a short-lived plain table instead.
> > Find one of those and change it to use a temp table.
>
> Hmm ... I looked through the core regression tests' usages of EXPLAIN
> VERBOSE and didn't really find any that it seemed to make sense to change
> that way.  I guess we've been more effective at programming around that
> restriction than I thought.
>
> Anyway, after looking at the 0001 patch, I think there's a pretty large
> oversight in that it doesn't touch ruleutils.c, although EXPLAIN relies
> heavily on that to print expressions and suchlike.  We could account
> for that as in the attached revision of 0001.
>
> However, I wonder whether this isn't going in the wrong direction.
> Instead of piecemeal s/get_namespace_name/get_namespace_name_or_temp/,
> we should consider just putting this behavior right into
> get_namespace_name, and dropping the separate get_namespace_name_or_temp
> function.  I can't really see any situation in which it's important
> to report the exact schema name of our own temp schema.

That sounds much better because any wholesale change like that will
affect 100s of places in extensions and it would be easier if we made
just one change in core.

-- 
Simon Riggs                http://www.EnterpriseDB.com/



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Skip temporary table schema name from explain-verbose output.
Next
From: "Bossart, Nathan"
Date:
Subject: Re: Avoiding data loss with synchronous replication