Skip site navigation (1) Skip section navigation (2)

Event Triggers reduced, v1

From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Event Triggers reduced, v1
Date: 2012-06-15 20:27:50
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

Allow me to open the new season of the DML trigger series, named
pg_event_trigger. This first episode is all about setting up the drama,
so that next ones make perfect sense.

The attached patch contains all the infrastructure for event triggers
and also a first implementation of them for the event "command_start",
implemented in a single place in utility.c.

The infrastructure is about:

 - new catalog
 - grammar for new commands
 - documentation skeleton
 - pg_dump support
 - psql support
 - ability to actually run user triggers
 - written in "core languages"
    (pl/c, pl/pgsql, pl/python, pl/perl, pl/tcl)
 - limited subcommand handling
The goal for this first patch is to avoid semantics issues so that we
can get something technically clean in, and have more time to talk
semantics next times. The main discussion to avoid is deciding if we
want to fire event triggers for CREATE SEQUENCE and CREATE INDEX in a
command that just did implement a SERIAL PRIMARY KEY in a table.

This way of doing things is possible because we took time to set a road
map together with Robert when we were both in Ottawa, and because it's
early in the cycle. The complete feature still needs to happen before
9.3 is released, but any realistic progress has to be cut down.

Look, it's an easy little skinny patch to review, right:

git --no-pager diff --shortstat master
 62 files changed, 4546 insertions(+), 108 deletions(-)

This patch includes regression tests that we worked on with Thom last
rounds, remember that they only run in the serial schedule, that means
with `make installcheck` only. Adding noisy output at random while the
parallel schedule run is a good way to break all the regression testing,
so I've been avoiding that.

I don't think this patch is ready as it is, by the way, I couldn't
devote nearly enough time to have something that polished already. I
think even with setting the goal not to embrace semantics, reviewing
this patch will certainly bring some interesting design discussions.

Dimitri Fontaine
PostgreSQL DBA, Architecte

Attachment: event_triggers_v1.patch.gz
Description: application/octet-stream (41.4 KB)


pgsql-hackers by date

Next:From: Dimitri FontaineDate: 2012-06-15 20:39:23
Subject: Re: Backup docs
Previous:From: Kevin GrittnerDate: 2012-06-15 20:18:09
Subject: Re: [RFC][PATCH] Logical Replication/BDR prototype and architecture

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group