Robert Haas <robertmh...@gmail.com> writes: > On Mon, Jul 26, 2021 at 12:49 PM Tom Lane <t...@sss.pgh.pa.us> wrote: >> I can't really see any situation in which it's important >> to report the exact schema name of our own temp schema.
> It would actually be nice if there were some easy way of getting that > for the rare situations in which there are problems. I experimented with pushing the behavior into get_namespace_name, and immediately ran into problems, for example --- /home/postgres/pgsql/src/test/regress/expected/jsonb.out 2021-03-01 16:32 :13.348655633 -0500 +++ /home/postgres/pgsql/src/test/regress/results/jsonb.out 2021-07-26 13:10 :53.523540855 -0400 @@ -320,11 +320,9 @@ where tablename = 'rows' and schemaname = pg_my_temp_schema()::regnamespace::text order by 1; - attname | histogram_bounds ----------+-------------------------- - x | [1, 2, 3] - y | ["txt1", "txt2", "txt3"] -(2 rows) + attname | histogram_bounds +---------+------------------ +(0 rows) -- to_jsonb, timestamps select to_jsonb(timestamp '2014-05-28 12:22:35.614298'); What's happening here is that regnamespace_out is returning 'pg_temp' which doesn't match any name visible in pg_namespace. So that would pretty clearly break user queries as well as our own tests. I'm afraid that the wholesale behavior change I was imagining isn't going to work. Probably we'd better stick to doing something close to the v2 patch I posted. I'm still suspicious of that logic in event_trigger.c, though. regards, tom lane