Steve Singer ssinger_pg at sympatico.ca
Sat Jun 19 06:03:10 PDT 2010
On Sat, 19 Jun 2010, Jaime Casanova wrote:

> Hi,
>
> Someone drop a FK constraint without using slonik (in slony1 1.2.20)
> and inserted some rows in that table... some of those rows violate the
> dropped constraint and obviously the replica can't insert the data
> because in the replica the constraint still exist...
>
> if i try to drop the constraint in the replica it says something about
> a non related index (i guess this is because slony messed up
> pg_trigger catalog for disabling triggers)...
>
> i can't add the constraint in primary in order to properly drop it,
> because there are rows violating the constraint... so i try to drop
> the table from the replication set but because of the replica having
> pending events that command is waiting in the queu...
>
> so there is a way to solve this or i have to drop the replica and rebuild?

Use EXECUTE SCRIPT with the ONLY ON option.

slonik will restore all of the tables on the slave to the normal state, run 
your script and put disable the triggers again.


You might also want to do an EXECUTE SCRIPT ONLY ON on the master (even if 
the script is something trivial like SELECT '1').   There are some types of 
DDL where if not done in an execute script your triggers will be left in a 
bad state until the next time execute script is done to reset things.



>
> -- 
> Jaime Casanova         www.2ndQuadrant.com
> Soporte y capacitación de PostgreSQL
> _______________________________________________
> Slony1-general mailing list
> Slony1-general at lists.slony.info
> http://lists.slony.info/mailman/listinfo/slony1-general
>


More information about the Slony1-general mailing list