Troy Wolf troy at troywolf.com
Tue Aug 26 14:02:19 PDT 2008
Postgres 8.2
Slony 1.2.12
Two databases (one origin, one subscriber)
One replication set

We have a table (let's call it 'Foo') that has a foreign key relationship to
a column in another table (let's call it 'Bar'). Bar has a PRIMARY KEY
CONSTRAINT on this column (let's call it bar_pk).

Foo is not replicated. Bar is replicated. Foo is a table we no longer
use--this is why we never added it to the replication set.

Today, we dropped Foo from the origin database. No problem. When we tried to
drop Foo from the subscriber database, we got this error:

  bar_pk is an index

Lesson, although you may think it is safe to drop a non-replicated table
without using Slony's EXECUTE SCRIPT, you'd be wrong if that table has a
foreign-key relationship to a table that is replicated. If you find yourself
in this postion, you can use EXECUTE SCRIPT to drop the table from the
subscriber database by using the "EXECUTE ONLY ON" parameter of EXECUTE
SCRIPT.

EXECUTE SCRIPT
http://www.slony.info/documentation/stmtddlscript.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.slony.info/pipermail/slony1-general/attachments/20080826/=
708433ab/attachment.htm


More information about the Slony1-general mailing list