Christopher Browne <cbbrowne@gmail.com> writes:
> I'm poking at event triggers a bit; would like to set up some examples
> (and see if they
> work, or break down badly; both are interesting results) to do some
> validation of schema
> for Slony.
Cool, thanks!
> What I'm basically thinking about is to set up some event triggers that run on
> DROP TABLE / DROP SEQUENCE, and see about cleaning up the replication
> side of things (e.g. - inject a request to drop the table/sequence
> from replication).
Sure. In what got commited from the current patch series, you will only
know that a DROP TABLE (or DROP SEQUENCE) occured, and we're trying to
get to an agreement with Robert if we should prefer to add visibility to
such events that occurs in a CASCADE statement or rather add the OID
(and maybe the name) of the Object that's going to be dropped.
Your opinion is worth a lot on that matter, if you have one to share! :)
> I have a bit of a complaint as to what documentation is included; I don't see
> any references in the documentation to ddl_command_start / ddl_command_end,
> which seem to be necessary values for event triggers.
What we have now here:
http://www.postgresql.org/docs/devel/static/event-trigger-matrix.html
http://www.postgresql.org/docs/devel/static/sql-createeventtrigger.html
http://www.postgresql.org/docs/devel/static/plpgsql-trigger.html#PLPGSQL-EVENT-TRIGGER
Is it not visible enough, or really missing the point?
> I'd tend to think that there should be a new subsection in the "man page" for
> CREATE TRIGGER that includes at least two fully formed examples of event
> triggers, involving the two events in question. Is change of that
> sort in progress?
The event triggers are addressed in a whole new chapter of the docs,
maybe that's why you didn't find the docs?
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support