information_schema vs temp tables (was Re: [COMMITTERS] pgsql: Sequences were not being shown due to the use of lowercase `s`) - Mailing list pgsql-hackers

From Tom Lane
Subject information_schema vs temp tables (was Re: [COMMITTERS] pgsql: Sequences were not being shown due to the use of lowercase `s`)
Date
Msg-id 20915.1158191726@sss.pgh.pa.us
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Sequences were not being shown due to the use of lowercase `s`  ("Greg Sabino Mullane" <greg@turnstep.com>)
Responses Re: information_schema vs temp tables (was Re: [COMMITTERS] pgsql: Sequences were not being shown due to the use of lowercase `s`)
List pgsql-hackers
"Greg Sabino Mullane" <greg@turnstep.com> writes:
> ... I can't think of a use case where a user would not want to
> append a "is_visible" clause to the query above. That or start
> tracking which pg_temp_ schema belongs to whom.

Well, I'm still having a problem with this, because it seems like a
pretty klugy solution.  It's inefficient (the is_visible functions
are not cheap) and it's not hard to fool:
set search_path = pg_temp_N, ...

(This won't work for a non-superuser, because he'll not have USAGE
privilege on someone else's temp schema, but you seem to be worried
about hiding temp tables from superusers.)

If you're really intent on making it work this way, my vote is to
expose namespace.c's isOtherTempNamespace() as a SQL-callable function,
and add a test on that to the info-schema views, rather than relying on
is_visible or explicit knowledge of the temp-schema naming convention.

Perhaps we should expose bothpg_is_my_temp_schema(schema_oid)pg_is_other_temp_schema(schema_oid)

Thoughts?  Opinions about the function names?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Patch attribution and non-ASCII characters
Next
From: Arturo Perez
Date:
Subject: Re: Fixed length data types issue