postgresql/src/backend/commands
Alvaro Herrera 473ab40c8b Add sql_drop event for event triggers
This event takes place just before ddl_command_end, and is fired if and
only if at least one object has been dropped by the command.  (For
instance, DROP TABLE IF EXISTS of a table that does not in fact exist
will not lead to such a trigger firing).  Commands that drop multiple
objects (such as DROP SCHEMA or DROP OWNED BY) will cause a single event
to fire.  Some firings might be surprising, such as
ALTER TABLE DROP COLUMN.

The trigger is fired after the drop has taken place, because that has
been deemed the safest design, to avoid exposing possibly-inconsistent
internal state (system catalogs as well as current transaction) to the
user function code.  This means that careful tracking of object
identification is required during the object removal phase.

Like other currently existing events, there is support for tag
filtering.

To support the new event, add a new pg_event_trigger_dropped_objects()
set-returning function, which returns a set of rows comprising the
objects affected by the command.  This is to be used within the user
function code, and is mostly modelled after the recently introduced
pg_identify_object() function.

Catalog version bumped due to the new function.

Dimitri Fontaine and Álvaro Herrera
Review by Robert Haas, Tom Lane
2013-03-28 13:05:48 -03:00
..
aggregatecmds.c Code beautification for object-access hook machinery. 2013-03-06 20:53:25 -05:00
alter.c Allow extracting machine-readable object identity 2013-03-20 18:19:19 -03:00
analyze.c Arrange to cache FdwRoutine structs in foreign tables' relcache entries. 2013-03-06 23:48:09 -05:00
async.c Fix bogus when-to-deregister-from-listener-array logic. 2013-02-13 12:48:05 -05:00
cluster.c Extend object-access hook machinery to support post-alter events. 2013-03-17 22:57:26 -04:00
collationcmds.c Refactor ALTER some-obj RENAME implementation 2013-01-21 12:06:41 -03:00
comment.c Add a materialized view relations. 2013-03-03 18:23:31 -06:00
constraint.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
conversioncmds.c Refactor ALTER some-obj RENAME implementation 2013-01-21 12:06:41 -03:00
copy.c Support writable foreign tables. 2013-03-10 14:16:02 -04:00
createas.c Fix problems with incomplete attempt to prohibit OIDS with MVs. 2013-03-22 13:27:34 -05:00
dbcommands.c Extend object-access hook machinery to support post-alter events. 2013-03-17 22:57:26 -04:00
define.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
discard.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
dropcmds.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
event_trigger.c Add sql_drop event for event triggers 2013-03-28 13:05:48 -03:00
explain.c Support writable foreign tables. 2013-03-10 14:16:02 -04:00
extension.c Extend object-access hook machinery to support post-alter events. 2013-03-17 22:57:26 -04:00
foreigncmds.c Extend object-access hook machinery to support post-alter events. 2013-03-17 22:57:26 -04:00
functioncmds.c Extend object-access hook machinery to support post-alter events. 2013-03-17 22:57:26 -04:00
indexcmds.c Add a materialized view relations. 2013-03-03 18:23:31 -06:00
lockcmds.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
Makefile Add a materialized view relations. 2013-03-03 18:23:31 -06:00
matview.c Allow I/O reliability checks using 16-bit checksums 2013-03-22 13:54:07 +00:00
opclasscmds.c Extend object-access hook machinery to support post-alter events. 2013-03-17 22:57:26 -04:00
operatorcmds.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
portalcmds.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
prepare.c Add a materialized view relations. 2013-03-03 18:23:31 -06:00
proclang.c Code beautification for object-access hook machinery. 2013-03-06 20:53:25 -05:00
schemacmds.c Extend object-access hook machinery to support post-alter events. 2013-03-17 22:57:26 -04:00
seclabel.c Add a materialized view relations. 2013-03-03 18:23:31 -06:00
sequence.c Allow I/O reliability checks using 16-bit checksums 2013-03-22 13:54:07 +00:00
tablecmds.c Fix problems with incomplete attempt to prohibit OIDS with MVs. 2013-03-22 13:27:34 -05:00
tablespace.c Extend object-access hook machinery to support post-alter events. 2013-03-17 22:57:26 -04:00
trigger.c Extend object-access hook machinery to support post-alter events. 2013-03-17 22:57:26 -04:00
tsearchcmds.c Extend object-access hook machinery to support post-alter events. 2013-03-17 22:57:26 -04:00
typecmds.c Extend object-access hook machinery to support post-alter events. 2013-03-17 22:57:26 -04:00
user.c Extend object-access hook machinery to support post-alter events. 2013-03-17 22:57:26 -04:00
vacuum.c Add a materialized view relations. 2013-03-03 18:23:31 -06:00
vacuumlazy.c Allow I/O reliability checks using 16-bit checksums 2013-03-22 13:54:07 +00:00
variable.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
view.c Add a materialized view relations. 2013-03-03 18:23:31 -06:00