[Bucardo-general] Fwd: Migrating to Amazon Postgres RDS
Greg Sabino Mullane
greg at endpoint.com
Fri Mar 7 01:19:45 UTC 2014
On Thu, Mar 06, 2014 at 04:47:48PM -0800, Chris Keane wrote:
> 1. All triggers, both application and bucardo, get a snippet at the top to
> check if session_user = bucardo and if yes, immediately return. This is a
> way poor man's way to stop triggers firing on bucardo-related updates.
That will stop the user-defined triggers, but not the foreign keys. Which
could stop you dead in the water, because it can lead to consistency
errors. You may be able to work around this in the app by updating very
carefully, but it's pretty risky. Will also be a lot slower.
> 2. I somehow need to set an update order on goats so that foreign-key
> constrained fields get updated in the right order. I notice that herdmap
> has a field 'priority' and find_goats() uses it to return a list of goats
> in priority order. If I massaged the priority field so that source table
> fields get updated before foreign key reference tables, and assuming some
> related data gets inserted into a few tables, would the replication happen
> in herdmap.priority order?
Ah, there you go, I should have read this first. :) Yes, I think that will work.
Should be easy enough to test out. Note that the caveat about slowness
Greg Sabino Mullane greg at endpoint.com
End Point Corporation
PGP Key: 0x14964AC8
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 163 bytes
Desc: Digital signature
More information about the Bucardo-general