pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@2ndquadrant.com>
Cc: Dimitri Fontaine <dimitri@2ndQuadrant.fr>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Event Triggers: adding information
Date: Thu, 17 Jan 2013 21:48:01 -0500
Message-ID: <23579.1358477281@sss.pgh.pa.us> (raw)
In-Reply-To: <20130118013334.GE3074@awork2.anarazel.de>
References: <CA+TgmobykpymdGyfbCDEfS6+-50X-AKYTdK88fjMS4-mY5SBdw@mail.gmail.com>
	<m2ehhkrfqk.fsf@2ndQuadrant.fr>
	<CA+TgmobfeB_YpgMv5NjW52tG36Hg_DY=jq0XDkE5zwCstPQ4pg@mail.gmail.com>
	<m2pq14m7sx.fsf@2ndQuadrant.fr>
	<CA+TgmoYEW583z+oisToCYQMz2grzpavdXrCi3-W2D_+nucVhzQ@mail.gmail.com>
	<CA+U5nM+Uuh7cyHSJ5wN54twBUGSncJzqpZB83xuZw4VP7UCziQ@mail.gmail.com>
	<16675.1358454278@sss.pgh.pa.us>
	<m2hamfcwc8.fsf@2ndQuadrant.fr>
	<18941.1358462151@sss.pgh.pa.us>
	<m2ehhjbf48.fsf@2ndQuadrant.fr>
	<20130118013334.GE3074@awork2.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Andres Freund <andres@2ndquadrant.com> writes:
> I have no problem requiring C code to use the even data, be it via hooks
> or via C functions called from event triggers. The problem I have with
> putting in some hooks is that I doubt that you can find sensible spots
> with enough information to actually recreate the DDL for a remote system
> without doing most of the work for command triggers.

"most of the work"?  No, I don't think so.  Here's the thing that's
bothering me about that: if the use-case that everybody is worried about
is replication, then triggers of any sort are the Wrong Thing, IMO.

The difference between a replication hook and a trigger is that a
replication hook has no business changing any state of the local system,
whereas a trigger *has to be expected to change the state of the local
system* because if it has no side-effects you might as well not bother
firing it.  And the fear of having to cope with arbitrary side-effects
occuring in the midst of DDL is about 80% of my angst with this whole
concept.

If we're only interested in replication, let's put in some hooks whose
contract does not allow for side-effects on the local catalogs, and be
done.  Otherwise we'll be putting in man-years of unnecessary (or at
least unnecessary for this use-case) work.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (114+ messages)  latest in thread

Message-ID: <23579.1358477281@sss.pgh.pa.us>
Permalink:  ../23579.1358477281@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23579.1358477281@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@2ndquadrant.com, dimitri@2ndQuadrant.fr, simon@2ndquadrant.com, robertmhaas@gmail.com, alvherre@2ndquadrant.com
  Subject: Re: Event Triggers: adding information
  In-Reply-To: <23579.1358477281@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox