Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id BDD6D1B505F2 for ; Wed, 14 Mar 2012 14:48:04 -0300 (ADT) Received: from [89.206.182.251] (helo=zl-mail01.corp.patientline.net) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S7sIq-0005EQ-7a for pgsql-admin@postgresql.org; Wed, 14 Mar 2012 17:48:03 +0000 Received: from corppl-ex01.corp.patientline.net ([192.168.248.209]) by zl-mail01.corp.patientline.net (8.14.1/8.14.1) with ESMTP id q2EHle5D029910 for ; Wed, 14 Mar 2012 17:47:41 GMT Received: from 172.18.72.102 ([172.18.72.102]) by CORPPL-EX01.corp.patientline.net ([192.168.248.211]) with Microsoft Exchange Server HTTP-DAV ; Wed, 14 Mar 2012 17:47:39 +0000 Received: from hqdt-100030 by 192.168.248.211; 14 Mar 2012 17:47:39 +0000 Subject: Streaming Replication Hooks From: David Fennell To: pgsql-admin@postgresql.org Content-Type: multipart/alternative; boundary="=-d1V+LnpNwENuUJbtpCsA" Date: Wed, 14 Mar 2012 17:47:38 +0000 Message-ID: <1331747259.27014.8.camel@hqdt-100030> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 X-Host-Lookup-Failed: Reverse DNS lookup failed for 89.206.182.251 (failed) X-Pg-Spam-Score: 0.8 (/) X-Archive-Number: 201203/93 X-Sequence-Number: 39281 --=-d1V+LnpNwENuUJbtpCsA Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi All, I hope this is the correct mailing list to ask this question. We are setting up a system using postgresql 9.1 and streaming replication to copy reference data from a single central location to several remote sites. The database changes will come in clumps with long periods of no activity in between. I would like to add some kind of programmatic hook to tell us that new changes have been received from central so that we can trigger messages to be sent out to devices on the site that may require updates of their data so that I don't have to rely on polling the database(s). Is there any way to hook at this point? Even if it didn't tell exactly what had changed, just that a particular database or table had been modified that would be perfect. I don't mind what language is required either. =20 I found reference to wal_sender and wal_receiver hooks which sounds very close to what I need, but I suspect that wal_receiver is processed before the data is applied to the database and I would like a hook after the database has been updated. I am assuming that normal triggers cannot be used on a replicated database? Can someone confirm or deny this? Thanks in advance. Dave Fennell --=-d1V+LnpNwENuUJbtpCsA Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi All,

I hope this is the correct mailing list to ask this question.

We are setting up a system using postgresql 9.1 and streaming replication t= o copy reference data from a single central location to several remote site= s.  The database changes will come in clumps with long periods of no a= ctivity in between.  I would like to add some kind of programmatic hoo= k to tell us that new changes have been received from central so that we ca= n trigger messages to be sent out to devices on the site that may require u= pdates of their data so that I don't have to rely on polling the database(s= ).

Is there any way to hook at this point? Even if it didn't tell exactly what= had changed, just that a particular database or table had been modified th= at would be perfect.  I don't mind what language is required either.&n= bsp;

I found reference to wal_sender and wal_receiver hooks which sounds very cl= ose to what I need, but I suspect that wal_receiver is processed before the= data is applied to the database and I would like a hook after the database= has been updated.

I am assuming that normal triggers cannot be used on a replicated database?=   Can someone confirm or deny this?

Thanks in advance.

Dave Fennell --=-d1V+LnpNwENuUJbtpCsA--