Re: sql_drop Event Trigger - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: sql_drop Event Trigger
Date
Msg-id 20130305214218.GP9507@alvh.no-ip.org
Whole thread Raw
In response to Re: sql_drop Event Triggerg  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: sql_drop Event Trigger
List pgsql-hackers
Alvaro Herrera escribió:

> Hmm, maybe I should be considering a pair of macros instead --
> UTILITY_START_DROP and UTILITY_END_DROP.  I'll give this a try.  Other
> ideas are welcome.

This seems to work.  See attached; I like the result because there's no
clutter and it supports all three cases without a problem.

I also added a new output column to pg_event_trigger_dropped_objects,
"subobject_name", which is NULL except when a column is being dropped,
in which case it contains the column name.  Also, the "object type"
column now says "table column" instead of "table" when dropping a
column.

Another question arose in testing: this reports dropping of temp
objects, too, but of course not always: particularly not when temp
objects are dropped at the end of a session (or the beginning of a
session that reuses a previously used temp schema).  I find this rather
inconsistent and I wonder if we should instead suppress reporting of
temp objects.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Performance Improvement by reducing WAL for Update Operation
Next
From: Kevin Grittner
Date:
Subject: Re: Materialized views WIP patch