david.g.johnston@xxxxxxxxx wrote:
...
Right. Mea maxima culpa. « the current session's temporary-table schema... can be explicitly listed in the path by using the alias pg_temp. » It seems that the wording is wrong here: « The value for search_path must be a comma-separated list of schema names. » It's schema identifiers—and not schema names. Yes? Here's another test whose outcome surprises me... The problem was my stupid typo: writing « set search_path = 'pg_catalog, pg_temp'; » when I should *not* have typed those single quotes. Now the demo that I'd intended gets the outcome that I'd expected: select count(*) from pg_class; --------------<< 399 create temporary table pg_class(k int); select count(*) from pg_class; --------------<< 0 set search_path = pg_catalog, pg_temp; select count(*) from pg_class; --------------<< 400 The "Writing SECURITY DEFINER Functions Safely" section explicitly recommends that a subprogram includes a "set search_path" specification. But, as I read it, you're saying that this advice is wrong (at least when a function will be invoked in more than a bare "select" because it prevents inlining. Thanks, that's crystal clear now. |