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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: information_schema vs temp tables (was Re: [COMMITTERS] pgsql: Sequences were not being shown due to the use of lowercase `s`)
Date: 2006-09-13 23:55:26
Message-ID: 20915.1158191726@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

"Greg Sabino Mullane" <greg(at)turnstep(dot)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 both
pg_is_my_temp_schema(schema_oid)
pg_is_other_temp_schema(schema_oid)

Thoughts? Opinions about the function names?

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Meskes 2006-09-14 08:02:38 pgsql: Added missing constuctor/destructor for interval and date.
Previous Message Tom Lane 2006-09-13 23:42:26 pgsql: Some small editorialization on the description of CREATE INDEX

Browse pgsql-hackers by date

  From Date Subject
Next Message Arturo Perez 2006-09-14 00:23:52 Re: Fixed length data types issue
Previous Message Tom Lane 2006-09-13 23:15:23 Re: Patch attribution and non-ASCII characters