Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

Triggers in a Postgresql slave, not affecting primary database

$
0
0

What I need to do is to have a replication of my database in which to create some triggers to do stuff in certain events.

At the moment:

  • I have a primary database A in postgresql.
  • I have just set up a slave database B using WAL.
  • So now, B is of course a read only database

The point is that at this point, B is a readonly database, so I can't create my triggers.

Why doing it in a slave? Because I would like to affect as less as possible to the main project using the primary database.

I tried to stop the replication, to create the triggers in B and then start it again. But it never start replicating again, I guess because it detects that the schemas differ... :(

Any idea or alternative to get the same goal? Does it make sense to use a master-master replication? But in this case, will be my triggers created in my "slave" replicated to the "primary" database?

Note: I can't use BDR to replicate becase I have to provide support for postgresql 9.0


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>