Re: Maintaining a materialized view only on a replica - Mailing list pgsql-general

From Herouth Maoz
Subject Re: Maintaining a materialized view only on a replica
Date
Msg-id C8B94C63-118B-401D-BA6D-BE98768D301B@unicell.co.il
Whole thread Raw
In response to Re: Maintaining a materialized view only on a replica  (Craig Ringer <ringerc@ringerc.id.au>)
List pgsql-general
It's not an issue with the replication software. The reason the parts of the transaction are written out of order is that the original system that writes them in the first place makes no guarantees as to the order of writing.

So basically my question is whether a trigger that runs a full aggregate SQL query on the table that triggered it, joining with another table, checking the rows returned and doing the insert in the second table only when the data is complete is feasible, because that's basically what I need to do.

Herouth


On 05/09/2012, at 00:52, Craig Ringer wrote:

Subject changed to describe the problem. Reply in-line.

On 09/04/2012 07:57 PM, Herouth Maoz wrote:

The issue is that when an insert or an update is fired, I can't say
whether all the segments of the same transaction have been written yet,
and if only some of them were written, there is no guarantee on the
order in which they are written.

Does Slony-I provide stronger guarantees? If your replication doesn't guarantee ordering then you're going to have a very hard time doing this.

Is this
feasible at all? How would you achieve it?

I'd try to find a replication system that guaranteed ordering if at all possible.

--
Craig Ringer


--
חרות מעוז
יוניסל פתרונות סלולריים מתקדמים
☎ 03-5181717 שלוחה 742

pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: postgres process got stuck in "notify interrupt waiting" status
Next
From: Dipti Bharvirkar
Date:
Subject: Re: Error stopping postgresql service on a standby server.