aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-07-27 12:08:20 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2021-07-27 12:08:20 -0400
commit024515cac50e246d92bbe67e9de4da0f302972ef (patch)
treebe5ddc419801c3c84421b564fc87b62e3881c9da /src
parent48c5c9068211e0a04fd9553c8714b2821ed3ad17 (diff)
downloadpostgresql-024515cac50e246d92bbe67e9de4da0f302972ef.tar.gz
postgresql-024515cac50e246d92bbe67e9de4da0f302972ef.zip
In event triggers, use "pg_temp" only for our own temp schema.
pg_event_trigger_ddl_commands used "pg_temp" to refer to any temp schema, not only that of the current backend. This seems like overreach. It's somewhat unlikely that DDL commands would refer to temp objects of other sessions to begin with, but if they do, "pg_temp" would be a most misleading way to display the action. While this seems like a bug, it's not quite out of the realm of possibility that somebody out there is expecting the current behavior. Hence, fix in HEAD, but don't back-patch. Discussion: https://postgr.es/m/CAAJ_b97W=QaGmag9AhWNbmx3uEYsNkXWL+OVW1_E1D3BtgWvtw@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/event_trigger.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/backend/commands/event_trigger.c b/src/backend/commands/event_trigger.c
index 9c31c9e7637..71612d577e9 100644
--- a/src/backend/commands/event_trigger.c
+++ b/src/backend/commands/event_trigger.c
@@ -1982,11 +1982,7 @@ pg_event_trigger_ddl_commands(PG_FUNCTION_ARGS)
elog(ERROR,
"invalid null namespace in object %u/%u/%d",
addr.classId, addr.objectId, addr.objectSubId);
- /* XXX not quite get_namespace_name_or_temp */
- if (isAnyTempNamespace(schema_oid))
- schema = pstrdup("pg_temp");
- else
- schema = get_namespace_name(schema_oid);
+ schema = get_namespace_name_or_temp(schema_oid);
table_close(catalog, AccessShareLock);
}