Обсуждение: Urgent help neede - Important - Tks

Поиск
Список
Период
Сортировка

Urgent help neede - Important - Tks

От
Mr OCP
Дата:
Hi all

We are trying to implement replication on postgres 7.2
with java and to effectively run it we need to drop
all RI triggers from the slave database, but in case
when master database fails, we will be using Slave as
the master and would need to restore all these RI
triggers back on.

Therefore, what I need to know: is there a way to
place these RI triggers back on, please let me have
all your ideas, one way is to extract those RI
creation scripts from the dump but I need some ideas
how to do that, or if you have any other ideas,
scripts, anything would be greatly appreciated

Thanks
Mike

http://my.yahoo.com.au - My Yahoo!
- It's My Yahoo! Get your own!

Re: Urgent help neede - Important - Tks

От
Stephan Szabo
Дата:
On Sun, 27 Jan 2002, [iso-8859-1] Mr OCP wrote:

> We are trying to implement replication on postgres 7.2
> with java and to effectively run it we need to drop
> all RI triggers from the slave database, but in case
> when master database fails, we will be using Slave as
> the master and would need to restore all these RI
> triggers back on.
>
> Therefore, what I need to know: is there a way to
> place these RI triggers back on, please let me have
> all your ideas, one way is to extract those RI
> creation scripts from the dump but I need some ideas
> how to do that, or if you have any other ideas,
> scripts, anything would be greatly appreciated

Getting the RI creation from a dump should be pretty easy, it should
be the only things using CREATE CONSTRAINT TRIGGER.

If you don't mind losing all triggers on the tables in question, you
could also set reltriggers to 0 on the pg_class row for the tables
and then set it back to the correct value (the number of triggers)
when you want to re-enable them.  An example of the reset sql can
be found in a data only pg_dump.