mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
pg_event_trigger_dropped_objects: add is_temp column
It now also reports temporary objects dropped that are local to the backend. Previously we weren't reporting any temp objects because it was deemed unnecessary; but as it turns out, it is necessary if we want to keep close track of DDL command execution inside one session. Temp objects are reported as living in schema pg_temp, which works because such a schema-qualification always refers to the temp objects of the current session.
This commit is contained in:
15
src/backend/utils/cache/lsyscache.c
vendored
15
src/backend/utils/cache/lsyscache.c
vendored
@ -19,6 +19,7 @@
|
||||
#include "access/htup_details.h"
|
||||
#include "access/nbtree.h"
|
||||
#include "bootstrap/bootstrap.h"
|
||||
#include "catalog/namespace.h"
|
||||
#include "catalog/pg_amop.h"
|
||||
#include "catalog/pg_amproc.h"
|
||||
#include "catalog/pg_collation.h"
|
||||
@ -2884,6 +2885,20 @@ get_namespace_name(Oid nspid)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* get_namespace_name_or_temp
|
||||
* As above, but if it is this backend's temporary namespace, return
|
||||
* "pg_temp" instead.
|
||||
*/
|
||||
char *
|
||||
get_namespace_name_or_temp(Oid nspid)
|
||||
{
|
||||
if (isTempNamespace(nspid))
|
||||
return "pg_temp";
|
||||
else
|
||||
return get_namespace_name(nspid);
|
||||
}
|
||||
|
||||
/* ---------- PG_RANGE CACHE ---------- */
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user